Yoast\WP\SEO\Builders
Indexable_Term_Builder::find_alternative_image() protected Yoast 1.0
Finds an alternative image for the social image.
{} Это метод класса: Indexable_Term_Builder{}
Хуков нет.
Возвращает
Массив/true/false. False when not found, array with data when found.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->find_alternative_image( $indexable );
- $indexable(Indexable) (обязательный)
- The indexable.
Код Indexable_Term_Builder::find_alternative_image() Indexable Term Builder::find alternative image Yoast 15.6.2
protected function find_alternative_image( Indexable $indexable ) {
$content_image = $this->image->get_term_content_image( $indexable->object_id );
if ( $content_image ) {
return [
'image' => $content_image,
'source' => 'first-content-image',
];
}
return false;
}