Yoast\WP\SEO\Presenters\Open_Graph
Image_Presenter::filter()
Run the image content through the wpseo_opengraph_image
Метод класса: Image_Presenter{}
Хуки из метода
Возвращает
Массив
. The filtered image.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->filter( $image );
- $image(массив) (обязательный)
- The image.
Код Image_Presenter::filter() Image Presenter::filter Yoast 21.6
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; }