[wp-trac] [WordPress Trac] #48395: PHPDoc correction for add_help_tab() in wp-admin/includes/class-wp-screen.php
WordPress Trac
noreply at wordpress.org
Tue Oct 22 10:46:58 UTC 2019
#48395: PHPDoc correction for add_help_tab() in wp-admin/includes/class-wp-
screen.php
----------------------------+-----------------------------
Reporter: atachibana | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: minor | Keywords:
Focuses: docs |
----------------------------+-----------------------------
Enhanced missing information of Codex for add_help_tab() in wp-
admin/includes/class-wp-screen.php:
- Function description
- Parameter description
Codex: https://codex.wordpress.org/Class_Reference/WP_Screen/add_help_tab
Code Reference:
https://developer.wordpress.org/reference/classes/wp_screen/add_help_tab/
This is the action of inline docs and Codex migration initiatives.
{{{
Index: class-wp-screen.php
===================================================================
--- class-wp-screen.php (revision 46561)
+++ class-wp-screen.php (working copy)
@@ -594,8 +594,14 @@
/**
* Add a help tab to the contextual help for the screen.
- * Call this on the load-$pagenow hook for the relevant 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.
+ *
* @since 3.3.0
* @since 4.4.0 The `$priority` argument was added.
*
@@ -603,7 +609,7 @@
* Array of arguments used to display the help tab.
*
* @type string $title Title for the tab. Default false.
- * @type string $id Tab ID. Must be HTML-safe. Default
false.
+ * @type string $id Tab ID. Must be HTML-safe and should
be unique for this menu. It is NOT allowed to contain any empty spaces.
Default false.
* @type string $content Optional. Help tab content in plain
text or HTML. Default empty string.
* @type string $callback Optional. A callback to generate the
tab content. Default false.
* @type int $priority Optional. The priority of the tab,
used for ordering. Default 10.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48395>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list