Yoast\WP\SEO\Actions\Indexables
Indexable_Head_Action::for_post() public Yoast 1.0
Retrieves the head for a post.
{} Это метод класса: Indexable_Head_Action{}
Хуков нет.
Возвращает
Объект
. Object with head and status properties.
Использование
$Indexable_Head_Action = new Indexable_Head_Action(); $Indexable_Head_Action->for_post( $id );
- $id(число) (обязательный)
- The id.
Код Indexable_Head_Action::for_post() Indexable Head Action::for post Yoast 16.1.1
public function for_post( $id ) {
$meta = $this->meta_surface->for_post( $id );
if ( $meta === false ) {
return $this->for_404();
}
return (object) [
'head' => $meta->get_head(),
'status' => 200,
];
}