wc_prevent_endpoint_indexing()WC 2.5.3

No index our endpoints. Prevent indexing pages like order-received.

Хуков нет.

Возвращает

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

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

wc_prevent_endpoint_indexing();

Список изменений

С версии 2.5.3 Введена.

Код wc_prevent_endpoint_indexing() WC 8.7.0

function wc_prevent_endpoint_indexing() {
	// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.PHP.NoSilencedErrors.Discouraged
	if ( is_wc_endpoint_url() || isset( $_GET['download_file'] ) ) {
		@header( 'X-Robots-Tag: noindex' );
	}
	// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.PHP.NoSilencedErrors.Discouraged
}