Make WordPress Core


Ignore:
Timestamp:
06/26/2020 06:47:28 PM (19 months ago)
Author:
SergeyBiryukov
Message:

Docs: Standardize on "Returning a value from the filter" vs. "Passing a value to the filter".

The filter is the callback function added with add_filter(), therefore the hook passes a value to the filter, and the filter returns a value to change its behaviour.

The documentation is referring to the latter.

Props johnbillion.
See #49572, #16557.

File:
1 edited

Legend:

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

    r48121 r48185  
    4141     * The dynamic portion of the hook name, `$option`, refers to the option name.
    4242     *
    43      * Passing a truthy value to the filter will short-circuit retrieving
     43     * Returning a truthy value from the filter will short-circuit retrieving
    4444     * the option value, returning the passed value instead.
    4545     *
     
    688688     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
    689689     *
    690      * Passing a truthy value to the filter will effectively short-circuit retrieval
     690     * Returning a truthy value from the filter will effectively short-circuit retrieval
    691691     * of the transient, returning the passed value instead.
    692692     *
     
    12381238     * The dynamic portion of the hook name, `$option`, refers to the option name.
    12391239     *
    1240      * Passing a truthy value to the filter will effectively short-circuit retrieval,
    1241      * returning the passed value instead.
     1240     * Returning a truthy value from the filter will effectively short-circuit retrieval
     1241     * and return the passed value instead.
    12421242     *
    12431243     * @since 2.9.0 As 'pre_site_option_' . $key
     
    17511751     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
    17521752     *
    1753      * Passing a truthy value to the filter will effectively short-circuit retrieval,
    1754      * returning the passed value instead.
     1753     * Returning a truthy value from the filter will effectively short-circuit retrieval
     1754     * and return the passed value instead.
    17551755     *
    17561756     * @since 2.9.0
Note: See TracChangeset for help on using the changeset viewer.