wpseo_posts_for_focus_keyword
Allows enhancing the array of posts' that share their focus keywords with the post's focus keywords.
Использование
add_filter( 'wpseo_posts_for_focus_keyword', 'wp_kama_wpseo_posts_for_focus_keyword_filter', 10, 3 ); /** * Function for `wpseo_posts_for_focus_keyword` filter-hook. * * @param array $post_ids The array of posts' ids that share their related keywords with the post. * @param string $keyword The keyword to search for. * @param int $post_id The id of the post the keyword is associated to. * * @return array */ function wp_kama_wpseo_posts_for_focus_keyword_filter( $post_ids, $keyword, $post_id ){ // filter... return $post_ids; }
- $post_ids(массив)
- The array of posts' ids that share their related keywords with the post.
- $keyword(строка)
- The keyword to search for.
- $post_id(int)
- The id of the post the keyword is associated to.
Где вызывается хук
wpseo_posts_for_focus_keyword
yoast/inc/class-wpseo-meta.php 997
$post_ids = apply_filters( 'wpseo_posts_for_focus_keyword', $post_ids, $keyword, $post_id );