File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ class SettingsPage
18
18
*/
19
19
protected $ currentSection ;
20
20
21
+ /**
22
+ * @var array of WP_Screen::add_help_tab() arguments
23
+ */
24
+ protected $ helpTabs = array ();
25
+
21
26
public function __construct (array $ options = array ())
22
27
{
23
28
$ options ['field_values ' ] = get_option ($ options ['option_name ' ]);
@@ -153,7 +158,7 @@ public function setMenu()
153
158
154
159
if ($ reg ['parent_slug ' ] == 'own ' ) {
155
160
156
- add_menu_page (
161
+ $ hookSuffix = add_menu_page (
157
162
$ reg ['page_title ' ],
158
163
$ reg ['menu_title ' ],
159
164
$ reg ['capability ' ],
@@ -163,7 +168,7 @@ public function setMenu()
163
168
$ reg ['position ' ]
164
169
);
165
170
} else {
166
- add_submenu_page (
171
+ $ hookSuffix = add_submenu_page (
167
172
$ reg ['parent_slug ' ],
168
173
$ reg ['page_title ' ],
169
174
$ reg ['menu_title ' ],
@@ -172,5 +177,20 @@ public function setMenu()
172
177
array ($ this , 'render ' )
173
178
);
174
179
}
180
+
181
+ add_action ('load- ' .$ hookSuffix , array ($ this , 'addHelpTabs ' ));
182
+ }
183
+
184
+ /**
185
+ * Add Help Tabs
186
+ *
187
+ * @uses WP_Screen::add_help_tab()
188
+ */
189
+ public function addHelpTabs ()
190
+ {
191
+ foreach ($ this ->helpTabs as $ tab ) {
192
+ get_current_screen ()->add_help_tab ($ tab );
193
+ }
194
+
175
195
}
176
196
}
You can’t perform that action at this time.
0 commit comments