Yoast\WP\SEO\Presenters\Open_Graph
Image_Presenter::filter() protected Yoast 1.0
Run the image content through the wpseo_opengraph_image filter.
{} Это метод класса: Image_Presenter{}
Хуки из метода
Возвращает
Массив. The filtered image.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->filter( $image );
- $image(массив) (обязательный)
- The image.
Код Image_Presenter::filter() Image Presenter::filter Yoast 15.6.2
protected function filter( $image ) {
/**
* Filter: 'wpseo_opengraph_image' - Allow changing the Open Graph image.
*
* @api string - The URL of the Open Graph image.
*
* @param Indexable_Presentation $presentation The presentation of an indexable.
*/
$image_url = \trim( \apply_filters( 'wpseo_opengraph_image', $image['url'], $this->presentation ) );
if ( ! empty( $image_url ) && \is_string( $image_url ) ) {
$image['url'] = $image_url;
}
return $image;
}