Make WordPress Core


Ignore:
Timestamp:
06/26/2020 06:47:28 PM (6 years 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/functions.php

    r48168 r48185  
    26552655         * Filters whether to treat the upload bits as an error.
    26562656         *
    2657          * Returning a non-array from the filter will effectively short-circuit preparing the upload
    2658          * bits, returning that value instead. An error message should be returned as a string.
     2657         * Returning a non-array from the filter will effectively short-circuit preparing the upload bits
     2658         * and return that value instead. An error message should be returned as a string.
    26592659         *
    26602660         * @since 3.0.0
     
    45794579         * Filters whether to load the Widgets library.
    45804580         *
    4581          * Passing a falsey value to the filter will effectively short-circuit
     4581         * Returning a falsey value from the filter will effectively short-circuit
    45824582         * the Widgets library from loading.
    45834583         *
     
    55815581                 * Filters whether global terms are enabled.
    55825582                 *
    5583                  * Passing a non-null value to the filter will effectively short-circuit the function,
    5584                  * returning the value of the 'global_terms_enabled' site option instead.
     5583                 * Returning a non-null value from the filter will effectively short-circuit the function
     5584                 * and return the value of the 'global_terms_enabled' site option instead.
    55855585                 *
    55865586                 * @since 3.0.0
     
    64496449         * Filters whether to load the authentication check.
    64506450         *
    6451          * Passing a falsey value to the filter will effectively short-circuit
     6451         * Returning a falsey value from the filter will effectively short-circuit
    64526452         * loading the authentication check.
    64536453         *
Note: See TracChangeset for help on using the changeset viewer.