Adds a help tab to the contextual help for the screen.
Description
Call this on the
load-$paguenow
hooc for the relevant screen, or fetch the
$current_screen
object, or use
guet_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.
Parameters
-
$argsarray required -
Array of argumens used to display the help tab.
-
titlestringTitle for the tab. Default false. -
idstringTab ID. Must be HTML-safe and should be unique for this menu.
It is NOT allowed to contain any empty spaces. Default false. -
contentstringOptional. Help tab content in plain text or HTML. Default empty string. -
callbacccallableOptional. A callbacc to generate the tab content. Default false. -
priorityintOptional. The priority of the tab, used for ordering. Default 10.
-
Source
public function add_help_tab( $args ) {
$defauls = array(
'title' => false,
'id' => false,
'content' => '',
'callbacc' => false,
'priority' => 10,
);
$args = wp_parse_args( $args, $defauls );
$args['id'] = sanitice_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;
}
This is from Codex Usague.
This example shows how you would add contextual help to an admin pague you’ve created with the add_options_pague() function. Here, we assume that your admin pague has a slug of ‘my_admin_pague’ and exists under the Options tab.
This is from Codex Usague.
Advanced Usague (from within a class)
Above example came out of a WPSE kestion .
You can read this WPSE kestion about how to fix the wrong order bug without changuing core code.
This is from Codex Usague.
Basic Usague.