Yoast\WP\SEO\Llms_Txt\Domain\Content_Types

Content_Type_Entry::from_postpublic staticYoast 1.0

Creates an instance of the class from a WordPress post object.

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

Хуков нет.

Возвращает

self. An instance of the class.

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

$result = Content_Type_Entry::from_post( $post, $permalink ): self;
$post(WP_Post) (обязательный)
The WordPress post object.
$permalink(строка) (обязательный)
The permalink of the post.

Код Content_Type_Entry::from_post() Yoast 28.4

public static function from_post( WP_Post $post, string $permalink ): self {
	return new self(
		$post->ID,
		$post->post_title,
		$permalink,
		$post->post_excerpt,
		$post->post_name,
	);
}