wc_page_no_robots() WC 5.0.0
Disable search engines indexing core, dynamic, cart/checkout pages. Uses "wp_robots" filter introduced in WP 5.7.
Хуков нет.
Возвращает
Массив. Filtered robots directives.
Использование
wc_page_no_robots( $robots );
- $robots(массив) (обязательный)
- Associative array of robots directives.
Список изменений
С версии 5.0.0 | Введена. |
Код wc_page_no_robots() wc page no robots WC 5.0.0
function wc_page_no_robots( $robots ) {
if ( is_page( wc_get_page_id( 'cart' ) ) || is_page( wc_get_page_id( 'checkout' ) ) || is_page( wc_get_page_id( 'myaccount' ) ) ) {
return wp_robots_no_robots( $robots );
}
return $robots;
}