WordPress.org

Make WordPress Core

Changeset 49196


Ignore:
Timestamp:
10/18/2020 07:17:29 PM (12 months ago)
Author:
johnbillion
Message:

Docs: Improve the docs for the globals that are used in the actions and filters API.

See #50531, #50768

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-importer.php

    r49193 r49196  
    262262     *
    263263     * @global wpdb  $wpdb       WordPress database abstraction object.
    264      * @global array $wp_actions
     264     * @global int[] $wp_actions
    265265     */
    266266    public function stop_the_insanity() {
  • trunk/src/wp-includes/plugin.php

    r48327 r49196  
    2626
    2727/** @var WP_Hook[] $wp_filter */
    28 global $wp_filter, $wp_actions, $wp_current_filter;
     28global $wp_filter;
     29
     30/** @var int[] $wp_actions */
     31global $wp_actions;
     32
     33/** @var string[] $wp_current_filter */
     34global $wp_current_filter;
    2935
    3036if ( $wp_filter ) {
     
    94100 * @since 0.71
    95101 *
    96  * @global array $wp_filter A multidimensional array of all hooks and the callbacks hooked to them.
     102 * @global WP_Hook[] $wp_filter A multidimensional array of all hooks and the callbacks hooked to them.
    97103 *
    98104 * @param string   $tag             The name of the filter to hook the $function_to_add callback to.
     
    120126 * @since 2.5.0
    121127 *
    122  * @global array $wp_filter Stores all of the filters and actions.
     128 * @global WP_Hook[] $wp_filter Stores all of the filters and actions.
    123129 *
    124130 * @param string        $tag               The name of the filter hook.
     
    171177 * @since 0.71
    172178 *
    173  * @global array $wp_filter         Stores all of the filters and actions.
    174  * @global array $wp_current_filter Stores the list of current filters with the current one last.
     179 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
     180 * @global string[] $wp_current_filter Stores the list of current filters with the current one last.
    175181 *
    176182 * @param string $tag     The name of the filter hook.
     
    219225 * functions hooked to `$tag` are supplied using an array.
    220226 *
    221  * @global array $wp_filter         Stores all of the filters and actions.
    222  * @global array $wp_current_filter Stores the list of current filters with the current one last.
     227 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
     228 * @global string[] $wp_current_filter Stores the list of current filters with the current one last.
    223229 *
    224230 * @param string $tag  The name of the filter hook.
     
    267273 * @since 1.2.0
    268274 *
    269  * @global array $wp_filter Stores all of the filters and actions.
     275 * @global WP_Hook[] $wp_filter Stores all of the filters and actions.
    270276 *
    271277 * @param string   $tag                The filter hook to which the function to be removed is hooked.
     
    293299 * @since 2.7.0
    294300 *
    295  * @global array $wp_filter Stores all of the filters and actions.
     301 * @global WP_Hook[] $wp_filter Stores all of the filters and actions.
    296302 *
    297303 * @param string   $tag      The filter to remove hooks from.
     
    317323 * @since 2.5.0
    318324 *
    319  * @global array $wp_current_filter Stores the list of current filters with the current one last
     325 * @global string[] $wp_current_filter Stores the list of current filters with the current one last
    320326 *
    321327 * @return string Hook name of the current filter or action.
     
    352358 * @see current_filter()
    353359 * @see did_action()
    354  * @global array $wp_current_filter Current filter.
     360 * @global string[] $wp_current_filter Current filter.
    355361 *
    356362 * @param null|string $filter Optional. Filter to check. Defaults to null, which
     
    434440 *              by adding it to the function signature.
    435441 *
    436  * @global array $wp_filter         Stores all of the filters and actions.
    437  * @global array $wp_actions        Increments the amount of times action was triggered.
    438  * @global array $wp_current_filter Stores the list of current filters with the current one last.
     442 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
     443 * @global int[]     $wp_actions        Stores the number of times each action was triggered.
     444 * @global string[] $wp_current_filter Stores the list of current filters with the current one last.
    439445 *
    440446 * @param string $tag    The name of the action to be executed.
     
    486492 * @since 2.1.0
    487493 *
    488  * @global array $wp_actions Increments the amount of times action was triggered.
     494 * @global int[] $wp_actions Stores the number of times each action was triggered.
    489495 *
    490496 * @param string $tag The name of the action hook.
     
    508514 * @see do_action() This function is identical, but the arguments passed to the
    509515 *                  functions hooked to `$tag` are supplied using an array.
    510  * @global array $wp_filter         Stores all of the filters and actions.
    511  * @global array $wp_actions        Increments the amount of times action was triggered.
    512  * @global array $wp_current_filter Stores the list of current filters with the current one last.
     516 *
     517 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
     518 * @global int[]     $wp_actions        Stores the number of times each action was triggered.
     519 * @global string[]  $wp_current_filter Stores the list of current filters with the current one last.
    513520 *
    514521 * @param string $tag  The name of the action to be executed.
     
    866873 * @access private
    867874 *
    868  * @global array $wp_filter Stores all of the filters and actions.
     875 * @global WP_Hook[] $wp_filter Stores all of the filters and actions.
    869876 *
    870877 * @param array $args The collected parameters from the hook that was called.
Note: See TracChangeset for help on using the changeset viewer.