Yoast\WP\SEO\Actions

Indexables_Page_Action::get_least_seo_score()publicYoast 1.0

Устарела с версии 20.4. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Gets the posts with the lowest seo scores.

Метод класса: Indexables_Page_Action{}

Хуков нет.

Возвращает

Массив. The posts with the lowest seo scores as an array.

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

$Indexables_Page_Action = new Indexables_Page_Action();
$Indexables_Page_Action->get_least_seo_score( $limit );
$limit(int) (обязательный)
The maximum amount of results to return.

Список изменений

Устарела с 20.4

Код Indexables_Page_Action::get_least_seo_score() Yoast 22.4

public function get_least_seo_score( $limit ) {
	\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );

	// Where_not_equal needs the set to check against not to be empty.
	$least_seo_score_ignore_list = $this->options_helper->get( 'least_seo_score_ignore_list', [] );
	$ignore_list                 = empty( $least_seo_score_ignore_list ) ? [ -1 ] : $least_seo_score_ignore_list;

	$least_seo_score = $this->query()
		->select_many( 'id', 'object_id', 'object_sub_type', 'permalink', 'breadcrumb_title', 'primary_focus_keyword', 'primary_focus_keyword_score' )
		->where_not_in( 'id', $ignore_list )
		->where_not_equal( 'primary_focus_keyword', 0 )
		->order_by_asc( 'primary_focus_keyword_score' )
		->limit( $limit )
		->find_many();

	return \array_map( [ $this->indexable_repository, 'ensure_permalink' ], $least_seo_score );
}