wp_sitemaps_enabled
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', 'wp_kama_sitemaps_enabled_filter' );
/**
* Function for `wp_sitemaps_enabled` filter-hook.
*
* @param bool $is_enabled Whether XML Sitemaps are enabled or not.
*
* @return bool
*/
function wp_kama_sitemaps_enabled_filter( $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 );