wpseo_opengraph_image
Filter: wpseo_opengraph_image Allow changing the Open Graph image url.
Использование
add_filter( 'wpseo_opengraph_image', 'wp_kama_wpseo_opengraph_image_filter', 10, 2 );
/**
* Function for `wpseo_opengraph_image` filter-hook.
*
* @param string $image_url The URL of the Open Graph image.
* @param Indexable_Presentation $presentation The presentation of an indexable.
*
* @return string
*/
function wp_kama_wpseo_opengraph_image_filter( $image_url, $presentation ){
// filter...
return $image_url;
}
- $image_url(строка)
- The URL of the Open Graph image.
- $presentation(Indexable_Presentation)
- The presentation of an indexable.
Где вызывается хук
wpseo_opengraph_image
yoast/src/presenters/open-graph/image-presenter.php 102
$image_url = \apply_filters( 'wpseo_opengraph_image', $image['url'], $this->presentation );