|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Help is provided for this plugin on the plugin pages. |
|
4
|
|
|
* |
|
5
|
|
|
* @since 1.0.0 |
|
6
|
|
|
* @author Sébastien Dumont |
|
7
|
|
|
* @category Admin |
|
8
|
|
|
* @package Auto Load Next Post |
|
9
|
|
|
* @license GPL-2.0+ |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
if ( ! defined('ABSPATH')) { |
|
13
|
|
|
exit; |
|
14
|
|
|
} |
|
15
|
|
|
// Exit if accessed directly |
|
16
|
|
|
|
|
17
|
|
|
if ( ! class_exists('Auto_Load_Next_Post_Admin_Help')) { |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Class - Auto_Load_Next_Post_Admin_Help |
|
21
|
|
|
* |
|
22
|
|
|
* @since 1.0.0 |
|
23
|
|
|
*/ |
|
24
|
|
|
class Auto_Load_Next_Post_Admin_Help { |
|
|
|
|
|
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* Constructor |
|
28
|
|
|
* |
|
29
|
|
|
* @since 1.0.0 |
|
30
|
|
|
* @access public |
|
31
|
|
|
*/ |
|
32
|
|
|
public function __construct() { |
|
33
|
|
|
add_action('current_screen', array($this, 'add_help_tabs'), 50); |
|
34
|
|
|
} // END __construct() |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Adds help tabs to the plugin pages. |
|
38
|
|
|
* |
|
39
|
|
|
* @since 1.0.0 |
|
40
|
|
|
* @access public |
|
41
|
|
|
*/ |
|
42
|
|
|
public function add_help_tabs() { |
|
43
|
|
|
$screen = get_current_screen(); |
|
44
|
|
|
|
|
45
|
|
|
if ($screen->id != 'settings_page_auto-load-next-post-settings') { |
|
46
|
|
|
return; |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
$screen->add_help_tab(array( |
|
50
|
|
|
'id' => 'auto_load_next_post_docs_tab', |
|
51
|
|
|
'title' => __('Documentation', 'auto-load-next-post'), |
|
52
|
|
|
'content' => |
|
53
|
|
|
'<p>'.sprintf(__('Thank you for using <strong>%1$s</strong> :) Should you need help using <strong>%1$s</strong> please read the documentation.', 'auto-load-next-post'), 'Auto Load Next Post').'</p>'. |
|
54
|
|
|
'<p><a href="https://github.com/seb86/Auto-Load-Next-Post/wiki/" class="button button-primary" target="_blank">'.sprintf(__('%s Documentation', 'auto-load-next-post'), 'Auto Load Next Post').'</a></p>' |
|
55
|
|
|
)); |
|
56
|
|
|
|
|
57
|
|
|
$screen->add_help_tab(array( |
|
58
|
|
|
'id' => 'auto_load_next_post_bugs_tab', |
|
59
|
|
|
'title' => __('Found a bug?', 'auto-load-next-post'), |
|
60
|
|
|
'content' => |
|
61
|
|
|
'<p>'.sprintf(__('If you find a bug within <strong>%s</strong>, please create a ticket on GitHub via the <a href="%s" target="_blank">Github issues</a>. Ensure that you read the <a href="%s" target="_blank">contribution guidelines</a> prior to submitting your report. Be as descriptive as possible. Thank you.', 'auto-load-next-post'), 'Auto Load Next Post', 'https://github.com/seb86/Auto-Load-Next-Post/issues?state=open', 'https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md').'</p>'. |
|
62
|
|
|
'<p><a href="https://github.com/seb86/Auto-Load-Next-Post/issues/new" class="button button-primary" target="_blank">'.__('Report an Issue', 'auto-load-next-post').'</a></p>' |
|
63
|
|
|
)); |
|
64
|
|
|
|
|
65
|
|
|
$screen->add_help_tab(array( |
|
66
|
|
|
'id' => 'auto_load_next_post_support_tab', |
|
67
|
|
|
'title' => __('Support', 'auto-load-next-post'), |
|
68
|
|
|
'content' => |
|
69
|
|
|
'<p>'.sprintf(__('If you need support with <strong>%s</strong>, you may ask the WordPress community for help by opening a thread on the <a href="%s" target="_blank">WordPress.org support forum</a>.', 'auto-load-next-post'), 'Auto Load Next Post', 'https://wordpress.org/support/plugin/auto-load-next-post').'</p>'. |
|
70
|
|
|
'<p><a href="https://wordpress.org/support/plugin/auto-load-next-post" class="button button-primary" target="_blank">'.__('Create a Ticket', 'auto-load-next-post').'</a></p>' |
|
71
|
|
|
)); |
|
72
|
|
|
|
|
73
|
|
|
$screen->add_help_tab(array( |
|
74
|
|
|
'id' => 'auto_load_next_post_feedback_tab', |
|
75
|
|
|
'title' => __('Feedback', 'auto-load-next-post'), |
|
76
|
|
|
'content' => |
|
77
|
|
|
'<p>'.sprintf(__('Your feedback is most important as it helps improve <strong>%s</strong> to support what you need. You can either submit a review on WordPress.org or complete a simple survey.', 'auto-load-next-post'), 'Auto Load Next Post').'</p>'. |
|
78
|
|
|
'<p><a href="https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?filter=5#postform" class="button button-primary" target="_blank">'.__('Submit a Review', 'auto-load-next-post').'</a> | <a href="https://sebd86.polldaddy.com/s/auto-load-next-post" class="button button-secondary" target="_blank">'.__('Complete Survey', 'auto-load-next-post').'</a></p>' |
|
79
|
|
|
)); |
|
80
|
|
|
|
|
81
|
|
|
$screen->set_help_sidebar( |
|
82
|
|
|
'<p><strong>'.__('For more information:', 'auto-load-next-post').'</strong></p>'. |
|
83
|
|
|
'<p><a href="https://autoloadnextpost.com" target="_blank">'.sprintf(__('About %s', 'auto-load-next-post'), 'Auto Load Next Post').'</a></p>'. |
|
84
|
|
|
'<p><a href="https://wordpress.org/plugins/auto-load-next-post" target="_blank">'.__('Project on WordPress.org', 'auto-load-next-post').'</a></p>'. |
|
85
|
|
|
'<p><a href="https://github.com/seb86/Auto-Load-Next-Post/" target="_blank">'.__('Project on Github', 'auto-load-next-post').'</a></p>' |
|
86
|
|
|
); |
|
87
|
|
|
|
|
88
|
|
|
} // END add_help_tabs() |
|
89
|
|
|
|
|
90
|
|
|
} // END Auto_Load_Next_Post_Admin_Help class. |
|
91
|
|
|
|
|
92
|
|
|
} // END if class exists. |
|
93
|
|
|
|
|
94
|
|
|
return new Auto_Load_Next_Post_Admin_Help(); |
|
95
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.