wp_sitemaps_enabled хук-фильтр . WP 5.5.0
Filters whether XML Sitemaps are enabled or not.
When XML Sitemaps are disabled via this filter, rewrite rules are still in place to ensure a 404 is returned.
Использование
add_filter( 'wp_sitemaps_enabled', 'filter_function_name_5041' ); function filter_function_name_5041( $is_enabled ){ // filter... return $is_enabled; }
- $is_enabled(true/false)
- Whether XML Sitemaps are enabled or not.
По умолчанию: true for public sites
Список изменений
С версии 5.5.0 | Введена. |
Где вызывается хук
wp_sitemaps_enabled
wp-includes/sitemaps/class-wp-sitemaps.php 104
return (bool) apply_filters( 'wp_sitemaps_enabled', $is_enabled );