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
This commit is contained in:
Andrew Nacin
2011-11-02 20:14:10 +00:00
parent cb56cbb04e
commit 33ee9a7d04
30 changed files with 54 additions and 34 deletions
+23 -3
View File
@@ -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;
}