Yoast\WP\SEO\Helpers\Schema
Image_Helper::generate_from_url() public Yoast 1.0
Find an image based on its URL and generate a Schema object for it.
{} Это метод класса: Image_Helper{}
Хуков нет.
Возвращает
Массив. Schema ImageObject array.
Использование
$Image_Helper = new Image_Helper(); $Image_Helper->generate_from_url( $schema_id, $url, $caption );
- $schema_id(строка) (обязательный)
- The @id to use for the returned image.
- $url(строка) (обязательный)
- The image URL to base our object on.
- $caption(строка)
- An optional caption.
По умолчанию: ''
Код Image_Helper::generate_from_url() Image Helper::generate from url Yoast 15.6.2
public function generate_from_url( $schema_id, $url, $caption = '' ) {
$attachment_id = $this->image->get_attachment_by_url( $url );
if ( $attachment_id > 0 ) {
return $this->generate_from_attachment_id( $schema_id, $attachment_id, $caption );
}
return $this->simple_image_object( $schema_id, $url, $caption );
}