wpseo_sitemap_exclude_empty_terms_taxonomy
Filter the setting of excluding empty terms from the XML sitemap for a specific taxonomy.
Использование
add_filter( 'wpseo_sitemap_exclude_empty_terms_taxonomy', 'wp_kama_wpseo_sitemap_exclude_empty_terms_taxonomy_filter', 10, 2 );
/**
* Function for `wpseo_sitemap_exclude_empty_terms_taxonomy` filter-hook.
*
* @param bool $exclude Defaults to the sitewide setting.
* @param string $taxonomy_name The name of the taxonomy being processed.
*
* @return bool
*/
function wp_kama_wpseo_sitemap_exclude_empty_terms_taxonomy_filter( $exclude, $taxonomy_name ){
// filter...
return $exclude;
}
- $exclude(true|false)
- Defaults to the sitewide setting.
- $taxonomy_name(строка)
- The name of the taxonomy being processed.
Где вызывается хук
wpseo_sitemap_exclude_empty_terms_taxonomy
wpseo_sitemap_exclude_empty_terms_taxonomy
yoast/inc/sitemaps/class-taxonomy-sitemap-provider.php 94
$hide_empty_tax = apply_filters( 'wpseo_sitemap_exclude_empty_terms_taxonomy', $hide_empty, $taxonomy_name );
yoast/inc/sitemaps/class-taxonomy-sitemap-provider.php 197
$hide_empty_tax = apply_filters( 'wpseo_sitemap_exclude_empty_terms_taxonomy', $hide_empty, $taxonomy->name );