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

Allows enhancing the array of posts' that share their focus keywords with the post's related keywords.

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

add_filter( 'wpseo_posts_for_related_keywords', 'wp_kama_wpseo_posts_for_related_keywords_filter', 10, 2 );

/**
 * Function for `wpseo_posts_for_related_keywords` filter-hook.
 * 
 * @param array $usage   The array of posts' ids that share their focus keywords with the post.
 * @param int   $post_id The id of the post we're finding the usage of related keywords for.
 *
 * @return array
 */
function wp_kama_wpseo_posts_for_related_keywords_filter( $usage, $post_id ){

	// filter...
	return $usage;
}
$usage(массив)
The array of posts' ids that share their focus keywords with the post.
$post_id(int)
The id of the post we're finding the usage of related keywords for.

Где вызывается хук

WPSEO_Post_Metabox_Formatter::get_focus_keyword_usage()
wpseo_posts_for_related_keywords
yoast/admin/formatter/class-post-metabox-formatter.php 167
return apply_filters( 'wpseo_posts_for_related_keywords', $usage, $this->post->ID );

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

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