Yoast\WP\SEO\Services\Importing\Aioseo

Aioseo_Social_Images_Provider_Service::get_featured_image()publicYoast 1.0

Retrieves the url of the featured image.

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

Хуков нет.

Возвращает

Строку. The url of the featured image.

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

$Aioseo_Social_Images_Provider_Service = new Aioseo_Social_Images_Provider_Service();
$Aioseo_Social_Images_Provider_Service->get_featured_image( $post_id );
$post_id(int) (обязательный)
The post id to extract the image from.

Код Aioseo_Social_Images_Provider_Service::get_featured_image() Yoast 22.4

public function get_featured_image( $post_id ) {
	$feature_image_id = \get_post_thumbnail_id( $post_id );

	if ( $feature_image_id ) {
		return $this->image->get_attachment_image_source( $feature_image_id, 'fullsize' );
	}

	return '';
}