wphooks.info - redirect_canonical

redirect_canonical

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/canonical.php:
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
	/**
	 * Filters the canonical redirect URL.
	 *
	 * Returning false to this filter will cancel the redirect.
	 *
	 * @since 2.3.0
	 *
	 * @param string $redirect_url  The redirect URL.
	 * @param string $requested_url The requested URL.
	 */
	$redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url );

	// yes, again -- in case the filter aborted the request
	if ( ! $redirect_url || strip_fragment_from_url( $redirect_url ) == strip_fragment_from_url( $requested_url ) ) {
		return;
	}

	if ( $do_redirect ) {
		// protect against chained redirects
		if ( ! redirect_canonical( $redirect_url, false ) ) {