WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/03/2020 05:34:20 PM (15 months ago)
Author:
johnbillion
Message:

Docs: Add more information about how to use filters that run before WordPress initialises.

Fixes #50134

File:
1 edited

Legend:

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

    r49120 r49489  
    357357     * Normalizes filters set up before WordPress has initialized to WP_Hook objects.
    358358     *
    359      * @since 4.7.0
    360      *
    361      * @param array $filters Filters to normalize.
     359     * The `$filters` parameter should be an array keyed by hook name, with values
     360     * containing either:
     361     *
     362     *  - A `WP_Hook` instance
     363     *  - An array of callbacks keyed by their priorities
     364     *
     365     * Examples:
     366     *
     367     *     $filters = array(
     368     *         'wp_fatal_error_handler_enabled' => array(
     369     *             10 => array(
     370     *                 array(
     371     *                     'accepted_args' => 0,
     372     *                     'function'      => function() {
     373     *                         return false;
     374     *                     },
     375     *                 ),
     376     *             ),
     377     *         ),
     378     *     );
     379     *
     380     * @since 4.7.0
     381     *
     382     * @param array $filters Filters to normalize. See documentation above for details.
    362383     * @return WP_Hook[] Array of normalized filters.
    363384     */
Note: See TracChangeset for help on using the changeset viewer.