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