Yoast\WP\SEO\Presenters\Open_Graph

Image_Presenter::filter()protectedYoast 1.0

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() Yoast 22.4

protected function filter( $image ) {
	/**
	 * Filter: 'wpseo_opengraph_image' - Allow changing the Open Graph image.
	 *
	 * @param string                 $image_url    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;
}