Yoast\WP\SEO\Surfaces
Meta_Surface::for_posts
Returns the meta tags context for a number of posts.
Метод класса: Meta_Surface{}
Хуков нет.
Возвращает
Meta[]|false. The meta values. False if none could be found.
Использование
$Meta_Surface = new Meta_Surface(); $Meta_Surface->for_posts( $ids );
- $ids(int[]) (обязательный)
- The IDs of the posts.
Код Meta_Surface::for_posts() Meta Surface::for posts Yoast 27.9
public function for_posts( $ids ) {
$indexables = $this->repository->find_by_multiple_ids_and_type( $ids, 'post' );
if ( empty( $indexables ) ) {
return false;
}
// Remove all false values.
$indexables = \array_filter( $indexables );
return \array_map(
function ( $indexable ) {
return $this->build_meta( $this->context_memoizer->get( $indexable, 'Post_Type' ) );
},
$indexables,
);
}