Make WordPress Core


Ignore:
Timestamp:
06/02/2020 04:21:49 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Correct @param type for pre_redirect_guess_404_permalink filter.

Improve filter documentation for consistency with other similar short-circuit filters in core.

Follow-up to [47878].

See #16557.

File:
1 edited

Legend:

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

    r47878 r47885  
    825825
    826826/**
    827  * Attempts to guess the correct URL based on query vars
     827 * Attempts to guess the correct URL based on query vars.
    828828 *
    829829 * @since 2.3.0
     
    839839     * Filters whether to do redirect guess of 404 requests.
    840840     *
    841      * Returning a false value from the filter will disable redirect guess 404 permalink.
     841     * Passing a false value to the filter will disable the URL guessing
    842842     * and return early.
    843843     *
    844844     * @since 5.5.0
    845845     *
    846      * @param bool     $do_redirect_guess  Whether to do redirect guess 404 permalink. Default true.
     846     * @param bool $do_redirect_guess Whether to do redirect guess 404 permalink.
     847     *                                Default true.
    847848     */
    848849    if ( false === apply_filters( 'do_redirect_guess_404_permalink', true ) ) {
     
    853854     * Filters whether to short-circuit redirect guess of 404 requests.
    854855     *
    855      * Return a non-false value from the filter will short-circuit the handling and return early.
     856     * Passing a non-null value to the filter will effectively short-circuit
     857     * the URL guessing, returning the passed value instead.
    856858     *
    857859     * @since 5.5.0
    858860     *
    859      * @param bool     $pre  Whether to short-circuit redirect guess 404 permalink. Default null.
     861     * @param null|string $pre Whether to short-circuit redirect guess 404 permalink.
     862     *                         Default null to continue with the URL guessing.
    860863     */
    861864    $pre = apply_filters( 'pre_redirect_guess_404_permalink', null );
     
    869872         * Filters whether to do a strict or loose guess.
    870873         *
    871          * Returning true value from the filter will guess redirect only exact post_name matches.
     874         * Passing a truthy value to the filter will redirect only exact post_name matches.
    872875         *
    873876         * @since 5.5.0
    874877         *
    875          * @param bool     $strict_guess Whether to do a strict/exact guess. Default false.
     878         * @param bool $strict_guess Whether to do a strict/exact guess. Default false.
    876879         */
    877880        $strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false );
Note: See TracChangeset for help on using the changeset viewer.