PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 1.4.62 All 260 releases
propertyhive / includes / admin / class-ph-admin-help.php

class-ph-admin-help.php in Property Hive 2.3.0, at includes/admin/class-ph-admin-help.php

66 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Legacy public global class PH_Admin_Help; preserving the existing PH_* class name is required for plugin and extension compatibility.
19 class PH_Admin_Help {
20
21 /**
22 * Hook in tabs.
23 */
24 public function __construct() {
25 add_action( 'current_screen', array( $this, 'add_tabs' ), 50 );
26 }
27
28 /**
29 * Add help tabs.
30 */
31 public function add_tabs() {
32 $screen = get_current_screen();
33
34 if ( ! $screen || ! in_array( $screen->id, ph_get_screen_ids() ) ) {
35 return;
36 }
37
38 $screen->add_help_tab(
39 array(
40 'id' => 'propertyhive_support_tab',
41 'title' => __( 'Help &amp; Support', 'propertyhive' ),
42 'content' =>
43 '<h2>' . __( 'Property Hive Help &amp; Support', 'propertyhive' ) . '</h2>' .
44 '<p>' . sprintf(
45 /* translators: %s: URL to Property Hive documentation */
46 __( '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' ),
47 'https://docs.wp-property-hive.com'
48 ) . '</p>' .
49 '<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>' .
50 '<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>',
51 )
52 );
53
54 $screen->set_help_sidebar(
55 '<p><strong>' . __( 'For more information:', 'propertyhive' ) . '</strong></p>' .
56 '<p><a href="https://wp-property-hive.com?src=wordpress-help-tab" target="_blank">' . __( 'Property Hive website', 'propertyhive' ) . '</a></p>' .
57 '<p><a href="https://wordpress.org/plugins/propertyhive/" target="_blank">' . __( 'WordPress.org project', 'propertyhive' ) . '</a></p>' .
58 '<p><a href="https://github.com/propertyhive/WP-Property-Hive" target="_blank">' . __( 'GitHub project', 'propertyhive' ) . '</a></p>' .
59 '<p><a href="https://wp-property-hive.com/add-ons/?src=wordpress-help-tab" target="_blank">' . __( 'Add ons', 'propertyhive' ) . '</a></p>'
60 );
61 }
62 }
63
64 endif;
65
66 return new PH_Admin_Help();