Yoast\WP\SEO\Actions\Wincher
Wincher_Keyphrases_Action::collect_all_keyphrases
Collects all keyphrases known to Yoast.
Метод класса: Wincher_Keyphrases_Action{}
Хуки из метода
Возвращает
Массив.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->collect_all_keyphrases();
Код Wincher_Keyphrases_Action::collect_all_keyphrases() Wincher Keyphrases Action::collect all keyphrases Yoast 28.0
protected function collect_all_keyphrases() {
// Collect primary keyphrases first.
$keyphrases = \array_column(
$this->indexable_repository
->query()
->select( 'primary_focus_keyword' )
->where_not_null( 'primary_focus_keyword' )
->where( 'object_type', 'post' )
->where_not_equal( 'post_status', 'trash' )
->distinct()
->find_array(),
'primary_focus_keyword',
);
/**
* Filters the keyphrases collected by the Wincher integration from all the posts.
*
* @param array $keyphrases The keyphrases array.
*/
$keyphrases = \apply_filters( 'wpseo_wincher_all_keyphrases', $keyphrases );
// Filter out empty entries.
return \array_filter( $keyphrases );
}