| 1 |
<?php |
| 2 |
/** |
| 3 |
* Add some content to the help tab |
| 4 |
* |
| 5 |
* @package PropertyHive\Admin |
| 6 |
* @version 1.0.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
if ( ! class_exists( 'PH_Admin_Help' ) ) : |
| 14 |
|
| 15 |
/** |
| 16 |
* PH_Admin_Help Class. |
| 17 |
*/ |
| 18 |
class PH_Admin_Help { |
| 19 |
|
| 20 |
/** |
| 21 |
* Hook in tabs. |
| 22 |
*/ |
| 23 |
public function __construct() { |
| 24 |
add_action( 'current_screen', array( $this, 'add_tabs' ), 50 ); |
| 25 |
} |
| 26 |
|
| 27 |
/** |
| 28 |
* Add help tabs. |
| 29 |
*/ |
| 30 |
public function add_tabs() { |
| 31 |
$screen = get_current_screen(); |
| 32 |
|
| 33 |
if ( ! $screen || ! in_array( $screen->id, ph_get_screen_ids() ) ) { |
| 34 |
return; |
| 35 |
} |
| 36 |
|
| 37 |
$screen->add_help_tab( |
| 38 |
array( |
| 39 |
'id' => 'propertyhive_support_tab', |
| 40 |
'title' => __( 'Help & Support', 'propertyhive' ), |
| 41 |
'content' => |
| 42 |
'<h2>' . __( 'Property Hive Help & Support', 'propertyhive' ) . '</h2>' . |
| 43 |
'<p>' . sprintf( |
| 44 |
/* translators: %s: URL to Property Hive documentation */ |
| 45 |
__( 'Should you need help understanding, using, or extending Property Hive, <a href="%s" target="_blank">please read our documentation</a>. You will find all kinds of resources including snippets, tutorials and much more.', 'propertyhive' ), |
| 46 |
'https://docs.wp-property-hive.com' |
| 47 |
) . '</p>' . |
| 48 |
'<p>' . __( 'Before asking for help, we recommend checking the documentation. Otherwise, please get in touch and a member of our team will be happy to assist.', 'propertyhive' ) . '</p>' . |
| 49 |
'<p><a href="https://docs.wp-property-hive.com" class="button button-primary" target="_blank">' . __( 'View documentation', 'propertyhive' ) . '</a> <a href="https://wp-property-hive.com/support/?src=wordpress-help-tab" class="button" target="_blank">' . __( 'Get support', 'propertyhive' ) . '</a></p>', |
| 50 |
) |
| 51 |
); |
| 52 |
|
| 53 |
$screen->set_help_sidebar( |
| 54 |
'<p><strong>' . __( 'For more information:', 'propertyhive' ) . '</strong></p>' . |
| 55 |
'<p><a href="https://wp-property-hive.com?src=wordpress-help-tab" target="_blank">' . __( 'Property Hive website', 'propertyhive' ) . '</a></p>' . |
| 56 |
'<p><a href="https://wordpress.org/plugins/propertyhive/" target="_blank">' . __( 'WordPress.org project', 'propertyhive' ) . '</a></p>' . |
| 57 |
'<p><a href="https://github.com/propertyhive/WP-Property-Hive" target="_blank">' . __( 'GitHub project', 'propertyhive' ) . '</a></p>' . |
| 58 |
'<p><a href="https://wp-property-hive.com/add-ons/?src=wordpress-help-tab" target="_blank">' . __( 'Add ons', 'propertyhive' ) . '</a></p>' |
| 59 |
); |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
endif; |
| 64 |
|
| 65 |
return new PH_Admin_Help(); |