Yoast\WP\SEO\Generators\Schema
Main_Image::get_featured_image() private Yoast 1.0
Gets the image schema for the web page based on the featured image.
{} Это метод класса: Main_Image{}
Хуков нет.
Возвращает
Массив/null. The image schema object or null if there is no featured image.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_featured_image( $post_id, $image_id );
- $post_id(число) (обязательный)
- The post id.
- $image_id(строка) (обязательный)
- The image schema id.
Код Main_Image::get_featured_image() Main Image::get featured image Yoast 15.6.2
private function get_featured_image( $post_id, $image_id ) {
if ( ! \has_post_thumbnail( $post_id ) ) {
return null;
}
return $this->helpers->schema->image->generate_from_attachment_id( $image_id, \get_post_thumbnail_id( $post_id ) );
}