wpseo_sitemap_exclude_empty_terms хук-фильтрYoast 1.0

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_Taxonomy_Sitemap_Provider::get_index_links()
wpseo_sitemap_exclude_empty_terms
WPSEO_Taxonomy_Sitemap_Provider::get_sitemap_links()
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 ] );

Где используется хук в Yoast SEO

Использование не найдено.