wpseo_twitter_image
Filter: wpseo_twitter_image Allow changing the Twitter Card image.
Использование
add_filter( 'wpseo_twitter_image', 'wp_kama_wpseo_twitter_image_filter', 10, 2 );
/**
* Function for `wpseo_twitter_image` filter-hook.
*
* @param string $twitter_image Image URL string.
* @param Indexable_Presentation $presentation The presentation of an indexable.
*
* @return string
*/
function wp_kama_wpseo_twitter_image_filter( $twitter_image, $presentation ){
// filter...
return $twitter_image;
}
- $twitter_image(строка)
- Image URL string.
- $presentation(Indexable_Presentation)
- The presentation of an indexable.
Где вызывается хук
yoast/src/presenters/twitter/image-presenter.php 39
return (string) \apply_filters( 'wpseo_twitter_image', $this->presentation->twitter_image, $this->presentation );