Yoast\WP\SEO\Surfaces

Meta_Surface::for_post()publicYoast 1.0

Returns the meta tags context for a post.

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

Хуков нет.

Возвращает

Meta|false. The meta values. False if none could be found.

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

$Meta_Surface = new Meta_Surface();
$Meta_Surface->for_post( $id );
$id(int) (обязательный)
The ID of the post.

Код Meta_Surface::for_post() Yoast 22.4

public function for_post( $id ) {
	$indexable = $this->repository->find_by_id_and_type( $id, 'post' );

	if ( ! $indexable ) {
		return false;
	}

	return $this->build_meta( $this->context_memoizer->get( $indexable, 'Post_Type' ) );
}