Yoast\WP\SEO\Helpers
Redirect_Helper::do_unsafe_redirect()
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() Redirect Helper::do unsafe redirect Yoast 21.6
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; }