wpseo_sitemap_exclude_empty_terms
Filter the setting of excluding empty terms from the XML sitemap.
Использование
add_filter( 'wpseo_sitemap_exclude_empty_terms', 'wp_kama_wpseo_sitemap_exclude_empty_terms_filter', 10, 2 );
/**
* Function for `wpseo_sitemap_exclude_empty_terms` filter-hook.
*
* @param bool $exclude Defaults to true.
* @param array $taxonomy_names Array of names for the taxonomies being processed.
*
* @return bool
*/
function wp_kama_wpseo_sitemap_exclude_empty_terms_filter( $exclude, $taxonomy_names ){
// filter...
return $exclude;
}
- $exclude(true|false)
- Defaults to true.
- $taxonomy_names(массив)
- Array of names for the taxonomies being processed.
Где вызывается хук
wpseo_sitemap_exclude_empty_terms
wpseo_sitemap_exclude_empty_terms
yoast/inc/sitemaps/class-taxonomy-sitemap-provider.php 83
$hide_empty = apply_filters( 'wpseo_sitemap_exclude_empty_terms', true, $taxonomy_names );
yoast/inc/sitemaps/class-taxonomy-sitemap-provider.php 195
$hide_empty = apply_filters( 'wpseo_sitemap_exclude_empty_terms', true, [ $taxonomy->name ] );