Make WordPress Core


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

    r48184 r48185  
    850850     * Filters whether to attempt to guess a redirect URL for a 404 request.
    851851     *
    852      * Passing a false value to the filter will disable the URL guessing
     852     * Returning a false value from the filter will disable the URL guessing
    853853     * and return early without performing a redirect.
    854854     *
     
    856856     *
    857857     * @param bool $do_redirect_guess Whether to attempt to guess a redirect URL
    858      *                                for a 404 request. Default is true.
     858     *                                for a 404 request. Default true.
    859859     */
    860860    if ( false === apply_filters( 'do_redirect_guess_404_permalink', true ) ) {
     
    865865     * Short-circuits the redirect URL guessing for 404 requests.
    866866     *
    867      * Passing a non-null value to the filter will effectively short-circuit
     867     * Returning a non-null value from the filter will effectively short-circuit
    868868     * the URL guessing, returning the passed value instead.
    869869     *
     
    882882         * Filters whether to perform a strict guess for a 404 redirect.
    883883         *
    884          * Passing a truthy value to the filter will redirect only exact post_name matches.
     884         * Returning a truthy value from the filter will redirect only exact post_name matches.
    885885         *
    886886         * @since 5.5.0
Note: See TracChangeset for help on using the changeset viewer.