Yoast\WP\SEO\Services\Importing\Aioseo

Aioseo_Social_Images_Provider_Service::get_auto_image()publicYoast 1.0

Retrieves the url of the first available image. Tries each image source to get one 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_auto_image( $post_id );
$post_id(int) (обязательный)
The post id to extract the image from.

Код Aioseo_Social_Images_Provider_Service::get_auto_image() Yoast 22.4

public function get_auto_image( $post_id ) {
	$image = $this->get_first_attached_image( $post_id );

	if ( ! $image ) {
		$image = $this->get_first_image_in_content( $post_id );
	}

	return $image;
}