Yoast\WP\SEO\Helpers

Redirect_Helper::do_unsafe_redirect()publicYoast 1.0

Wraps wp_redirect to allow testing for redirects.

Метод класса: Redirect_Helper{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$Redirect_Helper = new Redirect_Helper();
$Redirect_Helper->do_unsafe_redirect( $location, $status, $reason );
$location(строка) (обязательный)
The path to redirect to.
$status(int)
The status code to use.
По умолчанию: 302
$reason(строка)
The reason for the redirect.
По умолчанию: 'Yoast SEO'

Код Redirect_Helper::do_unsafe_redirect() Yoast 22.3

public function do_unsafe_redirect( $location, $status = 302, $reason = 'Yoast SEO' ) {
	// phpcs:ignore WordPress.Security.SafeRedirect -- intentional, function has been renamed to make unsafe more clear.
	\wp_redirect( $location, $status, $reason );
	exit;
}