From 49f03fff79031470180eef6db0446bd8aad42926 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 2 Jun 2020 16:21:49 +0000 Subject: [PATCH] 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 --- src/wp-includes/canonical.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/wp-includes/canonical.php b/src/wp-includes/canonical.php index f4a4337fd2..42d6dcf44a 100644 --- a/src/wp-includes/canonical.php +++ b/src/wp-includes/canonical.php @@ -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 );