Adds a help tab to the contextual help for the screen.
Call this on the load-$pagenow hook for the relevant screen, or fetch the $current_screen object, or use get_current_screen() and then call the method from the object.
You may need to filter $current_screen using an if or switch statement to prevent new help tabs from being added to ALL admin screens.
$argsarrayrequired
title stringid stringcontent stringcallback callablepriority intpublic function add_help_tab( $args ) {
$defaults = array(
'title' => false,
'id' => false,
'content' => '',
'callback' => false,
'priority' => 10,
);
$args = wp_parse_args( $args, $defaults );
$args['id'] = sanitize_html_class( $args['id'] );
// Ensure we have an ID and title.
if ( ! $args['id'] || ! $args['title'] ) {
return;
}
// Allows for overriding an existing tab with that ID.
$this->_help_tabs[ $args['id'] ] = $args;
}
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_screen/add_help_tab