diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index 6d6b61b85..eaa7912c6 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -87,7 +87,7 @@ class Custom_Background { '

' . __( 'Don’t forget to click on the Save Changes button when you are finished.' ) . '

' ); - get_current_screen()->add_help_sidebar( + get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Custom Background' ) . '

' . '

' . __( 'Support Forums' ) . '

' diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 7b4ef851b..58747bb9f 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -105,7 +105,7 @@ class Custom_Image_Header { '

' . __( 'Some themes come with additional header images bundled. If you see multiple images displayed, select the one you’d like and click the Save Changes button.' ) . '

' ); - get_current_screen()->add_help_sidebar( + get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Custom Header' ) . '

' . '

' . __( 'Support Forums' ) . '

' diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index d97df12bc..b05cd38bf 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -119,7 +119,7 @@ add_contextual_help( $current_screen, '

' . __( 'You can manage comments made '

' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link below to learn more.' ) . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Comments' ) . '

' . '

' . __( 'Documentation on Comment Spam' ) . '

' . diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index d7a8bbda8..ae2e5572e 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -203,7 +203,7 @@ if ( 'post' == $post_type ) { 'content' => $discussion_settings, ) ); - get_current_screen()->add_help_sidebar( + get_current_screen()->set_help_sidebar( '

' . sprintf(__('You can also create posts with the Press This bookmarklet.'), 'options-writing.php') . '

' . '

' . __('For more information:') . '

' . '

' . __('Documentation on Writing and Editing Posts') . '

' . @@ -229,7 +229,7 @@ if ( 'post' == $post_type ) { 'content' => $page_attributes, ) ); - get_current_screen()->add_help_sidebar( + get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Adding New Pages') . '

' . '

' . __('Documentation on Editing Pages') . '

' . diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 027d8e811..1e7c0d6e0 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -45,7 +45,7 @@ add_contextual_help($current_screen, '

' . __( 'XFN stands for XHTML Friends Network, 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.' ) . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Creating Links' ) . '

' . '

' . __( 'Support Forums' ) . '

' diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 851b102ba..a6442751f 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -240,7 +240,7 @@ if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $t $help .= '

' . __('Support Forums') . '

'; - get_current_screen()->add_help_sidebar( $help ); + get_current_screen()->set_help_sidebar( $help ); unset($help); } diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 1d2e86b38..e08d2c92e 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -167,7 +167,7 @@ if ( 'post' == $post_type ) { '

' . __('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.') . '

' ); - get_current_screen()->add_help_sidebar( + get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Managing Posts') . '

' . '

' . __('Support Forums') . '

' @@ -179,7 +179,7 @@ if ( 'post' == $post_type ) { '

' . __('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.') . '

' ); - get_current_screen()->add_help_sidebar( + get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Managing Pages') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/export.php b/wp-admin/export.php index b31000986..91f6f9e13 100644 --- a/wp-admin/export.php +++ b/wp-admin/export.php @@ -43,7 +43,7 @@ add_contextual_help( $current_screen, '

' . __('Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Export') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/import.php b/wp-admin/import.php index b4bd468a2..41306ba14 100644 --- a/wp-admin/import.php +++ b/wp-admin/import.php @@ -21,7 +21,7 @@ add_contextual_help($current_screen, '

' . __('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.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Import') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/includes/screen.php b/wp-admin/includes/screen.php index dfeeac743..a94e808b6 100644 --- a/wp-admin/includes/screen.php +++ b/wp-admin/includes/screen.php @@ -153,7 +153,7 @@ function add_screen_option( $option, $args = array() ) { if ( ! $current_screen ) return; - return $current_screen->add_option( $option, $args ); + $current_screen->add_option( $option, $args ); } /** @@ -597,7 +597,7 @@ final class WP_Screen { /** * Add a help tab to the contextual help for the screen. - * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add contextual help tabs. + * Call this on the load-$pagenow hook for the relevant screen. * * @since 3.3.0 * @@ -626,6 +626,26 @@ final class WP_Screen { $this->_help_tabs[] = $args; } + /** + * Removes a help tab from the contextual help for the screen. + * + * @since 3.3.0 + * + * @param string $id The help tab ID. + */ + public function remove_help_tab( $id ) { + unset( $this->_help_tabs[ $id ] ); + } + + /** + * Removes all help tabs from the contextual help for the screen. + * + * @since 3.3.0 + */ + public function remove_help_tabs() { + $this->_help_tabs = array(); + } + /** * Add a sidebar to the contextual help for the screen. * 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 @@ final class WP_Screen { * * @param string $content Sidebar content in plain text or HTML. */ - public function add_help_sidebar( $content ) { + public function set_help_sidebar( $content ) { $this->_help_sidebar = $content; } diff --git a/wp-admin/index.php b/wp-admin/index.php index 95ef4ff21..8939e1685 100644 --- a/wp-admin/index.php +++ b/wp-admin/index.php @@ -70,7 +70,7 @@ get_current_screen()->add_help_tab( array( 'content' => $help_content, ) ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Dashboard' ) . '

' . '

' . __( 'Support Forums' ) . '

' diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index 0d7afd31d..9fbde91c8 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -47,7 +47,7 @@ add_contextual_help( $current_screen, '

' . __('If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Managing Links') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/media-upload.php b/wp-admin/media-upload.php index 9f41ff680..b0dcda55f 100644 --- a/wp-admin/media-upload.php +++ b/wp-admin/media-upload.php @@ -67,7 +67,7 @@ if ( isset($_GET['inline']) ) { '

' . __('There are two options for uploading files: Select Files will open the Flash-based uploader (multiple file upload allowed), or you can use the Browser Uploader. Clicking Select Files opens a navigation window showing you files in your operating system. Selecting Open after clicking on the file you want activates a progress bar on the uploader screen. Basic image editing is available after upload is complete. Make sure you click Save before leaving this screen.') . '

' ); - get_current_screen()->add_help_sidebar( + get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Uploading Media Files') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index fda4970ae..b5b639601 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -451,7 +451,7 @@ $help .= '

' . __('To create a new custom menu, click on the + tab, give the m add_contextual_help($current_screen, $help); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Menus') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/options-discussion.php b/wp-admin/options-discussion.php index 8f587770a..3f5fb9a69 100644 --- a/wp-admin/options-discussion.php +++ b/wp-admin/options-discussion.php @@ -20,7 +20,7 @@ add_contextual_help($current_screen, '

' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Discussion Settings') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index c65c32b46..8f76e0b2e 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -67,7 +67,7 @@ add_contextual_help($current_screen, '

' . __('Remember to click the Save Changes button at the bottom of the screen for new settings to take effect.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on General Settings') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/options-media.php b/wp-admin/options-media.php index d2c67752a..fc128bac5 100644 --- a/wp-admin/options-media.php +++ b/wp-admin/options-media.php @@ -22,7 +22,7 @@ add_contextual_help($current_screen, '

' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Media Settings') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 7b152487b..0ba1876ec 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -23,7 +23,7 @@ add_contextual_help($current_screen, '

' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Permalinks Settings') . '

' . '

' . __('Documentation on Using Permalinks') . '

' . diff --git a/wp-admin/options-privacy.php b/wp-admin/options-privacy.php index a771afbf8..e7df3d50f 100644 --- a/wp-admin/options-privacy.php +++ b/wp-admin/options-privacy.php @@ -21,7 +21,7 @@ add_contextual_help($current_screen, '

' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Privacy Settings') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/options-reading.php b/wp-admin/options-reading.php index 7cc74c1bb..45788d68f 100644 --- a/wp-admin/options-reading.php +++ b/wp-admin/options-reading.php @@ -48,7 +48,7 @@ add_contextual_help($current_screen, '

' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Reading Settings') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php index fc407541c..1dc164a34 100644 --- a/wp-admin/options-writing.php +++ b/wp-admin/options-writing.php @@ -20,7 +20,7 @@ add_contextual_help($current_screen, '

' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Writing Settings') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index d488e59e3..1c7c6ea77 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -325,7 +325,7 @@ add_contextual_help($current_screen, '

' . sprintf( __('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.'), WP_PLUGIN_DIR) . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Managing Plugins') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 9e12de6aa..52c6a59d1 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -44,7 +44,7 @@ if ( current_user_can('install_themes') ) add_contextual_help($current_screen, $help); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Using Themes') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/tools.php b/wp-admin/tools.php index 88bc4e8e9..f8ce70c77 100644 --- a/wp-admin/tools.php +++ b/wp-admin/tools.php @@ -17,7 +17,7 @@ add_contextual_help($current_screen, '

' . __('Note: Turbo/Gears is no longer promoted on this screen as it was in previous versions due to the fact that Google has discontinued support for it.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Tools') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index e4c80facf..739f5c529 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -424,7 +424,7 @@ add_contextual_help($current_screen, '

' . __('To update themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Updating WordPress') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/upload.php b/wp-admin/upload.php index f2f703786..8b07cee84 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -152,7 +152,7 @@ add_contextual_help( $current_screen, '

' . __( 'If a media file has not been attached to any post, you will see that in the Attached To column, and can click on Attach File to launch a small popup that will allow you to search for a post and attach the file.' ) . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Media Library' ) . '

' . '

' . __( 'Support Forums' ) . '

' diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 8c3ae9707..67dd3b3b7 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -45,7 +45,7 @@ add_contextual_help($current_screen, '

' . __('Remember to click the Update Profile button when you are finished.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on User Profiles') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php index 1c214fe1e..6a8778f27 100644 --- a/wp-admin/user-new.php +++ b/wp-admin/user-new.php @@ -146,7 +146,7 @@ add_contextual_help($current_screen, '

' . __('Remember to click the Add User button at the bottom of this screen when you are finished.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Adding New Users') . '

' . '

' . __('Support Forums') . '

' diff --git a/wp-admin/users.php b/wp-admin/users.php index 79ba1c0d1..b32222455 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -26,7 +26,7 @@ add_contextual_help($current_screen, '

' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '

' ); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Managing Users') . '

' . '

' . __('Descriptions of Roles and Capabilities') . '

' . diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index a85923cd3..0c6b29aaf 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -46,7 +46,7 @@ $help = ' add_contextual_help($current_screen, $help); -get_current_screen()->add_help_sidebar( +get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Widgets') . '

' . '

' . __('Support Forums') . '

'