Make WordPress Core

Ticket #52539: 52539.diff

File 52539.diff, 52.6 KB (added by dingo_d, 4 years ago)

A first pass of docblock changes

  • src/wp-admin/includes/class-custom-background.php

    diff --git a/src/wp-admin/includes/class-custom-background.php b/src/wp-admin/includes/class-custom-background.php
    index bc3c082bc3..245085a744 100644
    a b class Custom_Background { 
    4141         * Constructor - Register administration header callback.
    4242         *
    4343         * @since 3.0.0
    44          * @param callable $admin_header_callback
    45          * @param callable $admin_image_div_callback Optional custom image div output callback.
     44         * @param callable|string $admin_header_callback    Optional custom header output callback, or string denoting the callback name.
     45         * @param callable|string $admin_image_div_callback Optional custom image div output callback, or string denoting the callback name.
    4646         */
    4747        public function __construct( $admin_header_callback = '', $admin_image_div_callback = '' ) {
    4848                $this->admin_header_callback    = $admin_header_callback;
  • src/wp-admin/includes/class-custom-image-header.php

    diff --git a/src/wp-admin/includes/class-custom-image-header.php b/src/wp-admin/includes/class-custom-image-header.php
    index 76eddff973..71febac005 100644
    a b class Custom_Image_Header { 
    4949         * Constructor - Register administration header callback.
    5050         *
    5151         * @since 2.1.0
    52          * @param callable $admin_header_callback
    53          * @param callable $admin_image_div_callback Optional custom image div output callback.
     52         * @param callable|string $admin_header_callback    Optional custom header output callback, or string denoting the callback name.
     53         * @param callable|string $admin_image_div_callback Optional custom image div output callback, or string denoting the callback name.
    5454         */
    5555        public function __construct( $admin_header_callback, $admin_image_div_callback = '' ) {
    5656                $this->admin_header_callback    = $admin_header_callback;
  • src/wp-admin/includes/dashboard.php

    diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php
    index c7d6a00f44..fad5347fad 100644
    a b function wp_dashboard_setup() { 
    161161 *
    162162 * @global callable[] $wp_dashboard_control_callbacks
    163163 *
    164  * @param string   $widget_id        Widget ID  (used in the 'id' attribute for the widget).
    165  * @param string   $widget_name      Title of the widget.
    166  * @param callable $callback         Function that fills the widget with the desired content.
    167  *                                   The function should echo its output.
    168  * @param callable $control_callback Optional. Function that outputs controls for the widget. Default null.
    169  * @param array    $callback_args    Optional. Data that should be set as the $args property of the widget array
    170  *                                   (which is the second parameter passed to your callback). Default null.
    171  * @param string   $context          Optional. The context within the screen where the box should display.
    172  *                                   Accepts 'normal', 'side', 'column3', or 'column4'. Default 'normal'.
    173  * @param string   $priority         Optional. The priority within the context where the box should show.
     164 * @param string          $widget_id        Widget ID  (used in the 'id' attribute for the widget).
     165 * @param string          $widget_name      Title of the widget.
     166 * @param callable|string $callback         Function that fills the widget with the desired content, or string denoting the callback name.
     167 *                                          The function should echo its output.
     168 * @param callable        $control_callback Optional. Function that outputs controls for the widget. Default null.
     169 * @param array           $callback_args    Optional. Data that should be set as the $args property of the widget array
     170 *                                          (which is the second parameter passed to your callback). Default null.
     171 * @param string          $context          Optional. The context within the screen where the box should display.
     172 *                                          Accepts 'normal', 'side', 'column3', or 'column4'. Default 'normal'.
     173 * @param string          $priority         Optional. The priority within the context where the box should show.
    174174 *                                   Accepts 'high', 'core', 'default', or 'low'. Default 'core'.
    175175 */
    176176function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null, $context = 'normal', $priority = 'core' ) {
  • src/wp-admin/includes/deprecated.php

    diff --git a/src/wp-admin/includes/deprecated.php b/src/wp-admin/includes/deprecated.php
    index da725f8ccd..37e27df067 100644
    a b function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $le 
    163163 * @deprecated 3.0.0 Use register_setting()
    164164 * @see register_setting()
    165165 *
    166  * @param string $option_group A settings group name. Should correspond to an allowed option key name.
    167  *                             Default allowed option key names include 'general', 'discussion', 'media',
    168  *                             'reading', 'writing', 'misc', 'options', and 'privacy'.
    169  * @param string $option_name The name of an option to sanitize and save.
    170  * @param callable $sanitize_callback A callback function that sanitizes the option's value.
     166 * @param string          $option_group      A settings group name. Should correspond to an allowed option key name.
     167 *                                           Default allowed option key names include 'general', 'discussion', 'media',
     168 *                                           'reading', 'writing', 'misc', 'options', and 'privacy'.
     169 * @param string          $option_name      The name of an option to sanitize and save.
     170 * @param callable|string $sanitize_callback A callback function that sanitizes the option's value, or a string denoting the callback.
    171171 */
    172172function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
    173173        _deprecated_function( __FUNCTION__, '3.0.0', 'register_setting()' );
    function add_option_update_handler( $option_group, $option_name, $sanitize_callb 
    181181 * @deprecated 3.0.0 Use unregister_setting()
    182182 * @see unregister_setting()
    183183 *
    184  * @param string $option_group
    185  * @param string $option_name
    186  * @param callable $sanitize_callback
     184 * @param string          $option_group      A settings group name.
     185 * @param string          $option_name       The name of an option to sanitize and unregister.
     186 * @param callable|string $sanitize_callback A callback function that sanitizes the option's value, or a string denoting the callback.
    187187 */
    188188function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
    189189        _deprecated_function( __FUNCTION__, '3.0.0', 'unregister_setting()' );
    function _relocate_children( $old_ID, $new_ID ) { 
    14221422 * @see add_menu_page()
    14231423 * @global int $_wp_last_object_menu
    14241424 *
    1425  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1426  * @param string   $menu_title The text to be used for the menu.
    1427  * @param string   $capability The capability required for this menu to be displayed to the user.
    1428  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1429  * @param callable $function   The function to be called to output the content for this page.
    1430  * @param string   $icon_url   The url to the icon to be used for this menu.
     1425 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1426 * @param string          $menu_title The text to be used for the menu.
     1427 * @param string          $capability The capability required for this menu to be displayed to the user.
     1428 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1429 * @param callable|string $function   The function to be called to output the content for this page, or the string denoting the callback.
     1430 * @param string          $icon_url   The url to the icon to be used for this menu.
    14311431 * @return string The resulting page's hook_suffix.
    14321432 */
    14331433function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
    function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $fu 
    14551455 * @see add_menu_page()
    14561456 * @global int $_wp_last_utility_menu
    14571457 *
    1458  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1459  * @param string   $menu_title The text to be used for the menu.
    1460  * @param string   $capability The capability required for this menu to be displayed to the user.
    1461  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1462  * @param callable $function   The function to be called to output the content for this page.
    1463  * @param string   $icon_url   The url to the icon to be used for this menu.
     1458 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1459 * @param string          $menu_title The text to be used for the menu.
     1460 * @param string          $capability The capability required for this menu to be displayed to the user.
     1461 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1462 * @param callable|string $function   The function to be called to output the content for this page, or the string denoting the callback..
     1463 * @param string          $icon_url   The url to the icon to be used for this menu.
    14641464 * @return string The resulting page's hook_suffix.
    14651465 */
    14661466function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
  • src/wp-admin/includes/media.php

    diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
    index 93d850d606..fef0219b5b 100644
    a b function media_handle_sideload( $file_array, $post_id = 0, $desc = null, $post_d 
    513513 *
    514514 * @global int $body_id
    515515 *
    516  * @param callable $content_func Function that outputs the content.
    517  * @param mixed    ...$args      Optional additional parameters to pass to the callback function when it's called.
     516 * @param callable|string $content_func Function that outputs the content, or the string denoting the callback.
     517 * @param mixed           ...$args      Optional additional parameters to pass to the callback function when it's called.
    518518 */
    519519function wp_iframe( $content_func, ...$args ) {
    520520        _wp_admin_html_begin();
  • src/wp-admin/includes/plugin.php

    diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php
    index 18a4852e47..7789eba589 100644
    a b function uninstall_plugin( $plugin ) { 
    13071307 * @global array $_registered_pages
    13081308 * @global array $_parent_pages
    13091309 *
    1310  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1311  * @param string   $menu_title The text to be used for the menu.
    1312  * @param string   $capability The capability required for this menu to be displayed to the user.
    1313  * @param string   $menu_slug  The slug name to refer to this menu by. Should be unique for this menu page and only
    1314  *                             include lowercase alphanumeric, dashes, and underscores characters to be compatible
    1315  *                             with sanitize_key().
    1316  * @param callable $function   The function to be called to output the content for this page.
    1317  * @param string   $icon_url   The URL to the icon to be used for this menu.
    1318  *                             * Pass a base64-encoded SVG using a data URI, which will be colored to match
    1319  *                               the color scheme. This should begin with 'data:image/svg+xml;base64,'.
    1320  *                             * Pass the name of a Dashicons helper class to use a font icon,
    1321  *                               e.g. 'dashicons-chart-pie'.
    1322  *                             * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
    1323  * @param int      $position   The position in the menu order this item should appear.
     1310 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1311 * @param string          $menu_title The text to be used for the menu.
     1312 * @param string          $capability The capability required for this menu to be displayed to the user.
     1313 * @param string          $menu_slug  The slug name to refer to this menu by. Should be unique for this menu page and only
     1314 *                                    include lowercase alphanumeric, dashes, and underscores characters to be compatible
     1315 *                                    with sanitize_key().
     1316 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1317 * @param string          $icon_url   The URL to the icon to be used for this menu.
     1318 *                                    * Pass a base64-encoded SVG using a data URI, which will be colored to match
     1319 *                                      the color scheme. This should begin with 'data:image/svg+xml;base64,'.
     1320 *                                    * Pass the name of a Dashicons helper class to use a font icon,
     1321 *                                      e.g. 'dashicons-chart-pie'.
     1322 *                                    * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
     1323 * @param int             $position   The position in the menu order this item should appear.
    13241324 * @return string The resulting page's hook_suffix.
    13251325 */
    13261326function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null ) {
    function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $func 
    13821382 * @global array $_registered_pages
    13831383 * @global array $_parent_pages
    13841384 *
    1385  * @param string   $parent_slug The slug name for the parent menu (or the file name of a standard
    1386  *                              WordPress admin page).
    1387  * @param string   $page_title  The text to be displayed in the title tags of the page when the menu
    1388  *                              is selected.
    1389  * @param string   $menu_title  The text to be used for the menu.
    1390  * @param string   $capability  The capability required for this menu to be displayed to the user.
    1391  * @param string   $menu_slug   The slug name to refer to this menu by. Should be unique for this menu
    1392  *                              and only include lowercase alphanumeric, dashes, and underscores characters
    1393  *                              to be compatible with sanitize_key().
    1394  * @param callable $function    The function to be called to output the content for this page.
    1395  * @param int      $position    The position in the menu order this item should appear.
     1385 * @param string          $parent_slug The slug name for the parent menu (or the file name of a standard
     1386 *                                     WordPress admin page).
     1387 * @param string          $page_title  The text to be displayed in the title tags of the page when the menu
     1388 *                                     is selected.
     1389 * @param string          $menu_title  The text to be used for the menu.
     1390 * @param string          $capability  The capability required for this menu to be displayed to the user.
     1391 * @param string          $menu_slug   The slug name to refer to this menu by. Should be unique for this menu
     1392 *                                     and only include lowercase alphanumeric, dashes, and underscores characters
     1393 *                                     to be compatible with sanitize_key().
     1394 * @param callable|string $function    The function to be called to output the content for this page, or string denoting the callback name.
     1395 * @param int             $position    The position in the menu order this item should appear.
    13961396 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    13971397 */
    13981398function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, 
    14991499 * @since 1.5.0
    15001500 * @since 5.3.0 Added the `$position` parameter.
    15011501 *
    1502  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1503  * @param string   $menu_title The text to be used for the menu.
    1504  * @param string   $capability The capability required for this menu to be displayed to the user.
    1505  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1506  * @param callable $function   The function to be called to output the content for this page.
    1507  * @param int      $position   The position in the menu order this item should appear.
     1502 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1503 * @param string          $menu_title The text to be used for the menu.
     1504 * @param string          $capability The capability required for this menu to be displayed to the user.
     1505 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1506 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1507 * @param int             $position   The position in the menu order this item should appear.
    15081508 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    15091509 */
    15101510function add_management_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_management_page( $page_title, $menu_title, $capability, $menu_slug, 
    15231523 * @since 1.5.0
    15241524 * @since 5.3.0 Added the `$position` parameter.
    15251525 *
    1526  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1527  * @param string   $menu_title The text to be used for the menu.
    1528  * @param string   $capability The capability required for this menu to be displayed to the user.
    1529  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1530  * @param callable $function   The function to be called to output the content for this page.
    1531  * @param int      $position   The position in the menu order this item should appear.
     1526 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1527 * @param string          $menu_title The text to be used for the menu.
     1528 * @param string          $capability The capability required for this menu to be displayed to the user.
     1529 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1530 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1531 * @param int             $position   The position in the menu order this item should appear.
    15321532 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    15331533 */
    15341534function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $f 
    15471547 * @since 2.0.0
    15481548 * @since 5.3.0 Added the `$position` parameter.
    15491549 *
    1550  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1551  * @param string   $menu_title The text to be used for the menu.
    1552  * @param string   $capability The capability required for this menu to be displayed to the user.
    1553  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1554  * @param callable $function   The function to be called to output the content for this page.
    1555  * @param int      $position   The position in the menu order this item should appear.
     1550 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1551 * @param string          $menu_title The text to be used for the menu.
     1552 * @param string          $capability The capability required for this menu to be displayed to the user.
     1553 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1554 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1555 * @param int             $position   The position in the menu order this item should appear.
    15561556 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    15571557 */
    15581558function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $fun 
    15711571 * @since 3.0.0
    15721572 * @since 5.3.0 Added the `$position` parameter.
    15731573 *
    1574  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1575  * @param string   $menu_title The text to be used for the menu.
    1576  * @param string   $capability The capability required for this menu to be displayed to the user.
    1577  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1578  * @param callable $function   The function to be called to output the content for this page.
    1579  * @param int      $position   The position in the menu order this item should appear.
     1574 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1575 * @param string          $menu_title The text to be used for the menu.
     1576 * @param string          $capability The capability required for this menu to be displayed to the user.
     1577 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1578 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1579 * @param int             $position   The position in the menu order this item should appear.
    15801580 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    15811581 */
    15821582function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $f 
    15951595 * @since 2.1.3
    15961596 * @since 5.3.0 Added the `$position` parameter.
    15971597 *
    1598  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1599  * @param string   $menu_title The text to be used for the menu.
    1600  * @param string   $capability The capability required for this menu to be displayed to the user.
    1601  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1602  * @param callable $function   The function to be called to output the content for this page.
    1603  * @param int      $position   The position in the menu order this item should appear.
     1598 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1599 * @param string          $menu_title The text to be used for the menu.
     1600 * @param string          $capability The capability required for this menu to be displayed to the user.
     1601 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1602 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1603 * @param int             $position   The position in the menu order this item should appear.
    16041604 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    16051605 */
    16061606function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $fun 
    16241624 * @since 2.7.0
    16251625 * @since 5.3.0 Added the `$position` parameter.
    16261626 *
    1627  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1628  * @param string   $menu_title The text to be used for the menu.
    1629  * @param string   $capability The capability required for this menu to be displayed to the user.
    1630  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1631  * @param callable $function   The function to be called to output the content for this page.
    1632  * @param int      $position   The position in the menu order this item should appear.
     1627 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1628 * @param string          $menu_title The text to be used for the menu.
     1629 * @param string          $capability The capability required for this menu to be displayed to the user.
     1630 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1631 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1632 * @param int             $position   The position in the menu order this item should appear.
    16331633 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    16341634 */
    16351635function add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug, 
    16481648 * @since 2.7.0
    16491649 * @since 5.3.0 Added the `$position` parameter.
    16501650 *
    1651  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1652  * @param string   $menu_title The text to be used for the menu.
    1653  * @param string   $capability The capability required for this menu to be displayed to the user.
    1654  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1655  * @param callable $function   The function to be called to output the content for this page.
    1656  * @param int      $position   The position in the menu order this item should appear.
     1651 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1652 * @param string          $menu_title The text to be used for the menu.
     1653 * @param string          $capability The capability required for this menu to be displayed to the user.
     1654 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1655 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1656 * @param int             $position   The position in the menu order this item should appear.
    16571657 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    16581658 */
    16591659function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $fun 
    16721672 * @since 2.7.0
    16731673 * @since 5.3.0 Added the `$position` parameter.
    16741674 *
    1675  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1676  * @param string   $menu_title The text to be used for the menu.
    1677  * @param string   $capability The capability required for this menu to be displayed to the user.
    1678  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1679  * @param callable $function   The function to be called to output the content for this page.
    1680  * @param int      $position   The position in the menu order this item should appear.
     1675 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1676 * @param string          $menu_title The text to be used for the menu.
     1677 * @param string          $capability The capability required for this menu to be displayed to the user.
     1678 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1679 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1680 * @param int             $position   The position in the menu order this item should appear.
    16811681 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    16821682 */
    16831683function add_media_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_media_page( $page_title, $menu_title, $capability, $menu_slug, $fun 
    16961696 * @since 2.7.0
    16971697 * @since 5.3.0 Added the `$position` parameter.
    16981698 *
    1699  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1700  * @param string   $menu_title The text to be used for the menu.
    1701  * @param string   $capability The capability required for this menu to be displayed to the user.
    1702  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1703  * @param callable $function   The function to be called to output the content for this page.
    1704  * @param int      $position   The position in the menu order this item should appear.
     1699 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1700 * @param string          $menu_title The text to be used for the menu.
     1701 * @param string          $capability The capability required for this menu to be displayed to the user.
     1702 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1703 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1704 * @param int             $position   The position in the menu order this item should appear.
    17051705 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    17061706 */
    17071707function add_links_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_links_page( $page_title, $menu_title, $capability, $menu_slug, $fun 
    17201720 * @since 2.7.0
    17211721 * @since 5.3.0 Added the `$position` parameter.
    17221722 *
    1723  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1724  * @param string   $menu_title The text to be used for the menu.
    1725  * @param string   $capability The capability required for this menu to be displayed to the user.
    1726  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1727  * @param callable $function   The function to be called to output the content for this page.
    1728  * @param int      $position   The position in the menu order this item should appear.
     1723 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1724 * @param string          $menu_title The text to be used for the menu.
     1725 * @param string          $capability The capability required for this menu to be displayed to the user.
     1726 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1727 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1728 * @param int             $position   The position in the menu order this item should appear.
    17291729 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    17301730 */
    17311731function add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
    function add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $fun 
    17441744 * @since 2.7.0
    17451745 * @since 5.3.0 Added the `$position` parameter.
    17461746 *
    1747  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1748  * @param string   $menu_title The text to be used for the menu.
    1749  * @param string   $capability The capability required for this menu to be displayed to the user.
    1750  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1751  * @param callable $function   The function to be called to output the content for this page.
    1752  * @param int      $position   The position in the menu order this item should appear.
     1747 * @param string          $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1748 * @param string          $menu_title The text to be used for the menu.
     1749 * @param string          $capability The capability required for this menu to be displayed to the user.
     1750 * @param string          $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1751 * @param callable|string $function   The function to be called to output the content for this page, or string denoting the callback name.
     1752 * @param int             $position   The position in the menu order this item should appear.
    17531753 * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
    17541754 */
    17551755function add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
  • src/wp-admin/includes/template.php

    diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php
    index 746be839af..0e311346e4 100644
    a b function wp_import_upload_form( $action ) { 
    10051005 *
    10061006 * @param string                 $id            Meta box ID (used in the 'id' attribute for the meta box).
    10071007 * @param string                 $title         Title of the meta box.
    1008  * @param callable               $callback      Function that fills the box with the desired content.
    1009  *                                              The function should echo its output.
     1008 * @param callable|string        $callback      Function that fills the box with the desired content.
     1009 *                                              The function should echo its output, or string denoting the callback name.
    10101010 * @param string|array|WP_Screen $screen        Optional. The screen or screens on which to show the box
    10111011 *                                              (such as a post type, 'link', or 'comment'). Accepts a single
    10121012 *                                              screen ID, WP_Screen object, or array of screen IDs. Default
    function do_block_editor_incompatible_meta_box( $object, $box ) { 
    11861186 *
    11871187 * @access private
    11881188 *
    1189  * @param callable $callback The callback function to check.
     1189 * @param callable|string $callback The callback function to check or the string denoting the callback.
    11901190 * @return array|null The plugin that the callback belongs to, or null if it doesn't belong to a plugin.
    11911191 */
    11921192function _get_plugin_from_callback( $callback ) {
    function do_accordion_sections( $screen, $context, $object ) { 
    15441544 *
    15451545 * @global array $wp_settings_sections Storage array of all settings sections added to admin pages.
    15461546 *
    1547  * @param string   $id       Slug-name to identify the section. Used in the 'id' attribute of tags.
    1548  * @param string   $title    Formatted title of the section. Shown as the heading for the section.
    1549  * @param callable $callback Function that echos out any content at the top of the section (between heading and fields).
    1550  * @param string   $page     The slug-name of the settings page on which to show the section. Built-in pages include
    1551  *                           'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using
    1552  *                           add_options_page();
     1547 * @param string          $id       Slug-name to identify the section. Used in the 'id' attribute of tags.
     1548 * @param string          $title    Formatted title of the section. Shown as the heading for the section.
     1549 * @param callable|string $callback Function that echos out any content at the top of the section (between heading and fields), or string denoting the callback name.
     1550 * @param string          $page     The slug-name of the settings page on which to show the section. Built-in pages include
     1551 *                                  'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using
     1552 *                                  add_options_page();
    15531553 */
    15541554function add_settings_section( $id, $title, $callback, $page ) {
    15551555        global $wp_settings_sections;
    function add_settings_section( $id, $title, $callback, $page ) { 
    16031603 *
    16041604 * @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections.
    16051605 *
    1606  * @param string   $id       Slug-name to identify the field. Used in the 'id' attribute of tags.
    1607  * @param string   $title    Formatted title of the field. Shown as the label for the field
    1608  *                           during output.
    1609  * @param callable $callback Function that fills the field with the desired form inputs. The
    1610  *                           function should echo its output.
    1611  * @param string   $page     The slug-name of the settings page on which to show the section
    1612  *                           (general, reading, writing, ...).
    1613  * @param string   $section  Optional. The slug-name of the section of the settings page
    1614  *                           in which to show the box. Default 'default'.
    1615  * @param array    $args {
     1606 * @param string          $id       Slug-name to identify the field. Used in the 'id' attribute of tags.
     1607 * @param string          $title    Formatted title of the field. Shown as the label for the field
     1608 *                                  during output.
     1609 * @param callable|string $callback Function that fills the field with the desired form inputs. The
     1610 *                                  function should echo its output, or string denoting the callback name.
     1611 * @param string          $page     The slug-name of the settings page on which to show the section
     1612 *                                  (general, reading, writing, ...).
     1613 * @param string          $section  Optional. The slug-name of the section of the settings page
     1614 *                                  in which to show the box. Default 'default'.
     1615 * @param array           $args {
    16161616 *     Optional. Extra arguments used when outputting the field.
    16171617 *
    16181618 *     @type string $label_for When supplied, the setting title will be wrapped
  • src/wp-includes/class-wp-hook.php

    diff --git a/src/wp-includes/class-wp-hook.php b/src/wp-includes/class-wp-hook.php
    index eb43c10c05..64776773ef 100644
    a b final class WP_Hook implements Iterator, ArrayAccess { 
    6262         *
    6363         * @since 4.7.0
    6464         *
    65          * @param string   $tag             The name of the filter to hook the $function_to_add callback to.
    66          * @param callable $function_to_add The callback to be run when the filter is applied.
    67          * @param int      $priority        The order in which the functions associated with a particular action
    68          *                                  are executed. Lower numbers correspond with earlier execution,
    69          *                                  and functions with the same priority are executed in the order
    70          *                                  in which they were added to the action.
    71          * @param int      $accepted_args   The number of arguments the function accepts.
     65         * @param string          $tag             The name of the filter to hook the $function_to_add callback to.
     66         * @param callable|string $function_to_add The callback to be run when the filter is applied, or string denoting the callback name.
     67         * @param int             $priority        The order in which the functions associated with a particular action
     68         *                                         are executed. Lower numbers correspond with earlier execution,
     69         *                                         and functions with the same priority are executed in the order
     70         *                                         in which they were added to the action.
     71         * @param int             $accepted_args   The number of arguments the function accepts.
    7272         */
    7373        public function add_filter( $tag, $function_to_add, $priority, $accepted_args ) {
    7474                $idx = _wp_filter_build_unique_id( $tag, $function_to_add, $priority );
    final class WP_Hook implements Iterator, ArrayAccess { 
    163163         *
    164164         * @since 4.7.0
    165165         *
    166          * @param string   $tag                The filter hook to which the function to be removed is hooked.
    167          * @param callable $function_to_remove The callback to be removed from running when the filter is applied.
    168          * @param int      $priority           The exact priority used when adding the original filter callback.
     166         * @param string          $tag                The filter hook to which the function to be removed is hooked.
     167         * @param callable|string $function_to_remove The callback to be removed from running when the filter is applied, or string denoting the callback name.
     168         * @param int             $priority           The exact priority used when adding the original filter callback.
    169169         * @return bool Whether the callback existed before it was removed.
    170170         */
    171171        public function remove_filter( $tag, $function_to_remove, $priority ) {
  • src/wp-includes/plugin.php

    diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php
    index 7bcfc7aa94..cae78058f2 100644
    a b if ( ! isset( $wp_current_filter ) ) { 
    101101 *
    102102 * @global WP_Hook[] $wp_filter A multidimensional array of all hooks and the callbacks hooked to them.
    103103 *
    104  * @param string   $tag             The name of the filter to hook the $function_to_add callback to.
    105  * @param callable $function_to_add The callback to be run when the filter is applied.
    106  * @param int      $priority        Optional. Used to specify the order in which the functions
    107  *                                  associated with a particular action are executed.
    108  *                                  Lower numbers correspond with earlier execution,
    109  *                                  and functions with the same priority are executed
    110  *                                  in the order in which they were added to the action. Default 10.
    111  * @param int      $accepted_args   Optional. The number of arguments the function accepts. Default 1.
     104 * @param string          $tag             The name of the filter to hook the $function_to_add callback to.
     105 * @param callable|string $function_to_add The callback to be run when the filter is applied, or string denoting the callback name.
     106 * @param int             $priority        Optional. Used to specify the order in which the functions
     107 *                                         associated with a particular action are executed.
     108 *                                         Lower numbers correspond with earlier execution,
     109 *                                         and functions with the same priority are executed
     110 *                                         in the order in which they were added to the action. Default 10.
     111 * @param int             $accepted_args   Optional. The number of arguments the function accepts. Default 1.
    112112 * @return true
    113113 */
    114114function add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {
    function add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 
    130130 *
    131131 * @global WP_Hook[] $wp_filter Stores all of the filters and actions.
    132132 *
    133  * @param string         $tag               The name of the filter hook.
    134  * @param callable|false $function_to_check Optional. The callback to check for. Default false.
     133 * @param string                $tag               The name of the filter hook.
     134 * @param callable|false|string $function_to_check Optional. The callback to check for, or string denoting the callback name. Default false.
    135135 * @return bool|int If `$function_to_check` is omitted, returns boolean for whether the hook has
    136136 *                  anything registered. When checking a specific function, the priority of that
    137137 *                  hook is returned, or false if the function is not attached.
    function apply_filters_ref_array( $tag, $args ) { 
    274274 *
    275275 * @global WP_Hook[] $wp_filter Stores all of the filters and actions.
    276276 *
    277  * @param string   $tag                The filter hook to which the function to be removed is hooked.
    278  * @param callable $function_to_remove The name of the function which should be removed.
    279  * @param int      $priority           Optional. The priority of the function. Default 10.
     277 * @param string          $tag                The filter hook to which the function to be removed is hooked.
     278 * @param callable|string $function_to_remove The name of the function which should be removed, or string denoting the callback name.
     279 * @param int             $priority           Optional. The priority of the function. Default 10.
    280280 * @return bool    Whether the function existed before it was removed.
    281281 */
    282282function remove_filter( $tag, $function_to_remove, $priority = 10 ) {
    function doing_action( $action = null ) { 
    396396 *
    397397 * @since 1.2.0
    398398 *
    399  * @param string   $tag             The name of the action to which the $function_to_add is hooked.
    400  * @param callable $function_to_add The name of the function you wish to be called.
    401  * @param int      $priority        Optional. Used to specify the order in which the functions
    402  *                                  associated with a particular action are executed. Default 10.
    403  *                                  Lower numbers correspond with earlier execution,
    404  *                                  and functions with the same priority are executed
    405  *                                  in the order in which they were added to the action.
    406  * @param int      $accepted_args   Optional. The number of arguments the function accepts. Default 1.
     399 * @param string          $tag             The name of the action to which the $function_to_add is hooked.
     400 * @param callable|string $function_to_add The name of the function you wish to be called, or string denoting the callback name.
     401 * @param int             $priority        Optional. Used to specify the order in which the functions
     402 *                                         associated with a particular action are executed. Default 10.
     403 *                                         Lower numbers correspond with earlier execution,
     404 *                                         and functions with the same priority are executed
     405 *                                         in the order in which they were added to the action.
     406 * @param int             $accepted_args   Optional. The number of arguments the function accepts. Default 1.
    407407 * @return true Will always return true.
    408408 */
    409409function add_action( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {
    function do_action_ref_array( $tag, $args ) { 
    563563 *
    564564 * @see has_filter() has_action() is an alias of has_filter().
    565565 *
    566  * @param string         $tag               The name of the action hook.
    567  * @param callable|false $function_to_check Optional. The callback to check for. Default false.
     566 * @param string                $tag               The name of the action hook.
     567 * @param callable|string|false $function_to_check Optional. The callback to check for, or string denoting the callback name. Default false.
    568568 * @return bool|int If `$function_to_check` is omitted, returns boolean for whether the hook has
    569569 *                  anything registered. When checking a specific function, the priority of that
    570570 *                  hook is returned, or false if the function is not attached.
    function has_action( $tag, $function_to_check = false ) { 
    582582 *
    583583 * @since 1.2.0
    584584 *
    585  * @param string   $tag                The action hook to which the function to be removed is hooked.
    586  * @param callable $function_to_remove The name of the function which should be removed.
    587  * @param int      $priority           Optional. The priority of the function. Default 10.
     585 * @param string          $tag                The action hook to which the function to be removed is hooked.
     586 * @param callable|string $function_to_remove The name of the function which should be removed, or string denoting the callback name.
     587 * @param int             $priority           Optional. The priority of the function. Default 10.
    588588 * @return bool Whether the function is removed.
    589589 */
    590590function remove_action( $tag, $function_to_remove, $priority = 10 ) {
    function plugin_dir_url( $file ) { 
    782782 *
    783783 * @since 2.0.0
    784784 *
    785  * @param string   $file     The filename of the plugin including the path.
    786  * @param callable $function The function hooked to the 'activate_PLUGIN' action.
     785 * @param string          $file     The filename of the plugin including the path.
     786 * @param callable|string $function The function hooked to the 'activate_PLUGIN' action, or string denoting the callback name.
    787787 */
    788788function register_activation_hook( $file, $function ) {
    789789        $file = plugin_basename( $file );
    function register_activation_hook( $file, $function ) { 
    805805 *
    806806 * @since 2.0.0
    807807 *
    808  * @param string   $file     The filename of the plugin including the path.
    809  * @param callable $function The function hooked to the 'deactivate_PLUGIN' action.
     808 * @param string          $file     The filename of the plugin including the path.
     809 * @param callable|string $function The function hooked to the 'deactivate_PLUGIN' action, or string denoting the callback name.
    810810 */
    811811function register_deactivation_hook( $file, $function ) {
    812812        $file = plugin_basename( $file );
    function _wp_call_all_hook( $args ) { 
    907907 *              and the function always returns a string.
    908908 * @access private
    909909 *
    910  * @param string   $tag      Unused. The name of the filter to build ID for.
    911  * @param callable $function The function to generate ID for.
    912  * @param int      $priority Unused. The order in which the functions
    913  *                           associated with a particular action are executed.
     910 * @param string          $tag      Unused. The name of the filter to build ID for.
     911 * @param callable|string $function The function to generate ID for, or string denoting the callback name.
     912 * @param int             $priority Unused. The order in which the functions
     913 *                                  associated with a particular action are executed.
    914914 * @return string Unique function ID for usage as array key.
    915915 */
    916916function _wp_filter_build_unique_id( $tag, $function, $priority ) {
  • src/wp-includes/rewrite.php

    diff --git a/src/wp-includes/rewrite.php b/src/wp-includes/rewrite.php
    index 4a204c2601..9eba9da491 100644
    a b function remove_permastruct( $name ) { 
    243243 *
    244244 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    245245 *
    246  * @param string   $feedname Feed name.
    247  * @param callable $function Callback to run on feed display.
     246 * @param string          $feedname Feed name.
     247 * @param callable|string $function Callback to run on feed display, or string denoting the callback name.
    248248 * @return string Feed action name.
    249249 */
    250250function add_feed( $feedname, $function ) {
  • src/wp-includes/shortcodes.php

    diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php
    index 62d1d1e644..06d71a0cd8 100644
    a b $shortcode_tags = array(); 
    5353 *
    5454 * @global array $shortcode_tags
    5555 *
    56  * @param string   $tag      Shortcode tag to be searched in post content.
    57  * @param callable $callback The callback function to run when the shortcode is found.
    58  *                           Every shortcode callback is passed three parameters by default,
    59  *                           including an array of attributes (`$atts`), the shortcode content
    60  *                           or null if not set (`$content`), and finally the shortcode tag
    61  *                           itself (`$shortcode_tag`), in that order.
     56 * @param string          $tag      Shortcode tag to be searched in post content.
     57 * @param callable|string $callback The callback function to run when the shortcode is found, or string denoting the callback name.
     58 *                                  Every shortcode callback is passed three parameters by default,
     59 *                                  including an array of attributes (`$atts`), the shortcode content
     60 *                                  or null if not set (`$content`), and finally the shortcode tag
     61 *                                  itself (`$shortcode_tag`), in that order.
    6262 */
    6363function add_shortcode( $tag, $callback ) {
    6464        global $shortcode_tags;