Yoast\WP\SEO\Generators

Twitter_Image_Generator::add_from_indexable()protectedYoast 1.0

Adds an image based on the given indexable.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->add_from_indexable( $indexable, $image_container );
$indexable(Indexable) (обязательный)
The indexable.
$image_container(Images) (обязательный)
The image container.

Код Twitter_Image_Generator::add_from_indexable() Yoast 25.1

protected function add_from_indexable( Indexable $indexable, Images $image_container ) {
	if ( $indexable->twitter_image_id ) {
		$image_container->add_image_by_id( $indexable->twitter_image_id );
		return;
	}

	if ( $indexable->twitter_image ) {
		$image_container->add_image_by_url( $indexable->twitter_image );
	}
}