Skip to content

Commit 33ee9a7

Browse files
committed
s/add_help_sidebar/set_help_sidebar/g and introduce screen->remove_help_tab($id) and screen->remove_help_tabs(). see #19020, #18785.
git-svn-id: https://develop.svn.wordpress.org/trunk@19119 602fd350-edb4-49c9-b593-d223f7449a82
1 parent cb56cbb commit 33ee9a7

30 files changed

Lines changed: 54 additions & 34 deletions

wp-admin/custom-background.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function admin_load() {
8787
'<p>' . __( 'Don&#8217;t forget to click on the Save Changes button when you are finished.' ) . '</p>'
8888
);
8989

90-
get_current_screen()->add_help_sidebar(
90+
get_current_screen()->set_help_sidebar(
9191
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
9292
'<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Background_Screen" target="_blank">Documentation on Custom Background</a>' ) . '</p>' .
9393
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'

wp-admin/custom-header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function help() {
105105
'<p>' . __( 'Some themes come with additional header images bundled. If you see multiple images displayed, select the one you&#8217;d like and click the Save Changes button.' ) . '</p>'
106106
);
107107

108-
get_current_screen()->add_help_sidebar(
108+
get_current_screen()->set_help_sidebar(
109109
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
110110
'<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Header_Screen" target="_blank">Documentation on Custom Header</a>' ) . '</p>' .
111111
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'

wp-admin/edit-comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
'<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link below to learn more.' ) . '</p>'
120120
);
121121

122-
get_current_screen()->add_help_sidebar(
122+
get_current_screen()->set_help_sidebar(
123123
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
124124
'<p>' . __( '<a href="http://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
125125
'<p>' . __( '<a href="http://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .

wp-admin/edit-form-advanced.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
'content' => $discussion_settings,
204204
) );
205205

206-
get_current_screen()->add_help_sidebar(
206+
get_current_screen()->set_help_sidebar(
207207
'<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'options-writing.php') . '</p>' .
208208
'<p><strong>' . __('For more information:') . '</strong></p>' .
209209
'<p>' . __('<a href="http://codex.wordpress.org/Posts_Add_New_Screen" target="_blank">Documentation on Writing and Editing Posts</a>') . '</p>' .
@@ -229,7 +229,7 @@
229229
'content' => $page_attributes,
230230
) );
231231

232-
get_current_screen()->add_help_sidebar(
232+
get_current_screen()->set_help_sidebar(
233233
'<p><strong>' . __('For more information:') . '</strong></p>' .
234234
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_Screen" target="_blank">Documentation on Adding New Pages</a>') . '</p>' .
235235
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages" target="_blank">Documentation on Editing Pages</a>') . '</p>' .

wp-admin/edit-link-form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
'<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/" target="_blank">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>'
4646
);
4747

48-
get_current_screen()->add_help_sidebar(
48+
get_current_screen()->set_help_sidebar(
4949
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
5050
'<p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>' .
5151
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'

wp-admin/edit-tags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240

241241
$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
242242

243-
get_current_screen()->add_help_sidebar( $help );
243+
get_current_screen()->set_help_sidebar( $help );
244244

245245
unset($help);
246246
}

wp-admin/edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
'<p>' . __('You can also edit multiple posts at once. Select the posts you want to edit using the checkboxes, select Edit from the Bulk Actions menu and click Apply. You will be able to change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.') . '</p>'
168168
);
169169

170-
get_current_screen()->add_help_sidebar(
170+
get_current_screen()->set_help_sidebar(
171171
'<p><strong>' . __('For more information:') . '</strong></p>' .
172172
'<p>' . __('<a href="http://codex.wordpress.org/Posts_Screen" target="_blank">Documentation on Managing Posts</a>') . '</p>' .
173173
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
@@ -179,7 +179,7 @@
179179
'<p>' . __('You can also perform the same types of actions, including narrowing the list by using the filters, acting on a Page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple Pages at once.') . '</p>'
180180
);
181181

182-
get_current_screen()->add_help_sidebar(
182+
get_current_screen()->set_help_sidebar(
183183
'<p><strong>' . __('For more information:') . '</strong></p>' .
184184
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Screen" target="_blank">Documentation on Managing Pages</a>') . '</p>' .
185185
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'

wp-admin/export.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function add_js() {
4343
'<p>' . __('Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.') . '</p>'
4444
);
4545

46-
get_current_screen()->add_help_sidebar(
46+
get_current_screen()->set_help_sidebar(
4747
'<p><strong>' . __('For more information:') . '</strong></p>' .
4848
'<p>' . __('<a href="http://codex.wordpress.org/Tools_Export_Screen" target="_blank">Documentation on Export</a>') . '</p>' .
4949
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'

wp-admin/import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
'<p>' . __('In previous versions of WordPress, all the importers were built-in, but they have been turned into plugins as of version 3.0 since most people only use them once or infrequently.') . '</p>'
2222
);
2323

24-
get_current_screen()->add_help_sidebar(
24+
get_current_screen()->set_help_sidebar(
2525
'<p><strong>' . __('For more information:') . '</strong></p>' .
2626
'<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_Screen" target="_blank">Documentation on Import</a>') . '</p>' .
2727
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'

wp-admin/includes/screen.php

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function add_screen_option( $option, $args = array() ) {
153153
if ( ! $current_screen )
154154
return;
155155

156-
return $current_screen->add_option( $option, $args );
156+
$current_screen->add_option( $option, $args );
157157
}
158158

159159
/**
@@ -597,7 +597,7 @@ public function get_option( $option, $key = false ) {
597597

598598
/**
599599
* Add a help tab to the contextual help for the screen.
600-
* Call this in template files after admin.php is loaded and before admin-header.php is loaded to add contextual help tabs.
600+
* Call this on the load-$pagenow hook for the relevant screen.
601601
*
602602
* @since 3.3.0
603603
*
@@ -626,6 +626,26 @@ public function add_help_tab( $args ) {
626626
$this->_help_tabs[] = $args;
627627
}
628628

629+
/**
630+
* Removes a help tab from the contextual help for the screen.
631+
*
632+
* @since 3.3.0
633+
*
634+
* @param string $id The help tab ID.
635+
*/
636+
public function remove_help_tab( $id ) {
637+
unset( $this->_help_tabs[ $id ] );
638+
}
639+
640+
/**
641+
* Removes all help tabs from the contextual help for the screen.
642+
*
643+
* @since 3.3.0
644+
*/
645+
public function remove_help_tabs() {
646+
$this->_help_tabs = array();
647+
}
648+
629649
/**
630650
* Add a sidebar to the contextual help for the screen.
631651
* Call this in template files after admin.php is loaded and before admin-header.php is loaded to add a sidebar to the contextual help.
@@ -634,7 +654,7 @@ public function add_help_tab( $args ) {
634654
*
635655
* @param string $content Sidebar content in plain text or HTML.
636656
*/
637-
public function add_help_sidebar( $content ) {
657+
public function set_help_sidebar( $content ) {
638658
$this->_help_sidebar = $content;
639659
}
640660

0 commit comments

Comments
 (0)