Yoast\WP\SEO\Helpers

Crawl_Cleanup_Helper::should_avoid_redirect()publicYoast 1.0

Checks if the current URL is not robots, sitemap, empty or user is logged in.

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

Хуков нет.

Возвращает

true|false. True if the current URL is a valid URL.

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

$Crawl_Cleanup_Helper = new Crawl_Cleanup_Helper();
$Crawl_Cleanup_Helper->should_avoid_redirect();

Код Crawl_Cleanup_Helper::should_avoid_redirect() Yoast 23.4

public function should_avoid_redirect() {
	// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We're not processing anything yet...
	if ( \is_robots() || \get_query_var( 'sitemap' ) || empty( $_GET ) || \is_user_logged_in() ) {
		return true;
	}
	return false;
}