WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Class Reference/WP Screen/get help sidebar

This page is marked as incomplete. You can help Codex by expanding it.

Description

This function is used to get the sidebar to the Contextual Help menu in an admin page. The sidebar appears to the right-side of the main help content.

get_help_sidebar() is a method of the WP_Screen class, and can not be called directly.

Usage

<?php
$screen 
get_current_screen();
$sidebar_html $screen->get_help_sidebar();
?>

Example

Append a reminder to search the WordPress Codex for more information to every contextual help screen. You may need to use an if or switch statement if you want to customize the help sidebar on help screens that only contain tabs you added.

add_action('admin_head', 'my_custom_help');

function my_custom_help () {
    $screen = get_current_screen();
    $sidebar_html = $screen->get_help_sidebar();
    $my_sidebar = '<p>You might also be able to find more help by searching for it on the WordPress codex!</p>';
    $newsidebar = $sidebar_html . $my_sidebar; // Append my new sidebar content.
    $screen->set_help_sidebar($newsidebar);
}

Change Log

Source File

get_help_sidebar() is located in wp-admin/includes/screen.php.

Related

Topics

Functions