wc_prevent_endpoint_indexing()
No index our endpoints. Prevent indexing pages like order-received.
Хуков нет.
Возвращает
void. Ничего (null).
Использование
wc_prevent_endpoint_indexing();
Список изменений
| С версии 2.5.3 | Введена. |
Код wc_prevent_endpoint_indexing() wc prevent endpoint indexing WC 11.1.2
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
}