Yoast\WP\SEO\Abilities\Application
Post_SEO_Data_Collector::get_post_seo_data
Retrieves the SEO data for the posts matching the input.
Метод класса: Post_SEO_Data_Collector{}
Хуков нет.
Возвращает
array<int,. array<string, int|string|bool|null>>|WP_Error The SEO data for each matching post, or an error.
Использование
$Post_SEO_Data_Collector = new Post_SEO_Data_Collector(); $Post_SEO_Data_Collector->get_post_seo_data( $input );
- $input(array<string, int|строка|true|false|null>) (обязательный)
- The input containing an optional
'post_id','permalink', or'title'.
Код Post_SEO_Data_Collector::get_post_seo_data() Post SEO Data Collector::get post seo data Yoast 28.4
public function get_post_seo_data( array $input ) {
$indexables = $this->resolver->resolve_many( $input );
if ( $indexables instanceof WP_Error ) {
return $indexables;
}
$editable = $this->post_access_checker->filter_editable( $indexables );
// Every match was a post the user may not edit; an already empty match list
// (a title-search page past the last result) stays a valid empty result.
if ( $editable === [] && $indexables !== [] ) {
return $this->post_access_checker->forbidden_error();
}
return $this->field_map->indexables_to_arrays( $editable );
}