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.

git-svn-id: https://develop.svn.wordpress.org/trunk@47885 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-06-02 16:21:49 +00:00
parent 9bea5b3444
commit 49f03fff79

View File

@ -824,7 +824,7 @@ function strip_fragment_from_url( $url ) {
}
/**
* Attempts to guess the correct URL based on query vars
* Attempts to guess the correct URL based on query vars.
*
* @since 2.3.0
*
@ -838,12 +838,13 @@ function redirect_guess_404_permalink() {
/**
* Filters whether to do redirect guess of 404 requests.
*
* Returning a false value from the filter will disable redirect guess 404 permalink.
* Passing a false value to the filter will disable the URL guessing
* and return early.
*
* @since 5.5.0
*
* @param bool $do_redirect_guess Whether to do redirect guess 404 permalink. Default true.
* @param bool $do_redirect_guess Whether to do redirect guess 404 permalink.
* Default true.
*/
if ( false === apply_filters( 'do_redirect_guess_404_permalink', true ) ) {
return false;
@ -852,11 +853,13 @@ function redirect_guess_404_permalink() {
/**
* Filters whether to short-circuit redirect guess of 404 requests.
*
* Return a non-false value from the filter will short-circuit the handling and return early.
* Passing a non-null value to the filter will effectively short-circuit
* the URL guessing, returning the passed value instead.
*
* @since 5.5.0
*
* @param bool $pre Whether to short-circuit redirect guess 404 permalink. Default null.
* @param null|string $pre Whether to short-circuit redirect guess 404 permalink.
* Default null to continue with the URL guessing.
*/
$pre = apply_filters( 'pre_redirect_guess_404_permalink', null );
if ( null !== $pre ) {
@ -868,11 +871,11 @@ function redirect_guess_404_permalink() {
/**
* Filters whether to do a strict or loose guess.
*
* Returning true value from the filter will guess redirect only exact post_name matches.
* Passing a truthy value to the filter will redirect only exact post_name matches.
*
* @since 5.5.0
*
* @param bool $strict_guess Whether to do a strict/exact guess. Default false.
* @param bool $strict_guess Whether to do a strict/exact guess. Default false.
*/
$strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false );