wpseo_twitter_site
Filter: wpseo_twitter_site Allow changing the Twitter site account as output in the Twitter card by Yoast SEO.
Использование
add_filter( 'wpseo_twitter_site', 'wp_kama_wpseo_twitter_site_filter', 10, 2 );
/**
* Function for `wpseo_twitter_site` filter-hook.
*
* @param string $twitter_site Twitter site account string.
* @param Indexable_Presentation $presentation The presentation of an indexable.
*
* @return string
*/
function wp_kama_wpseo_twitter_site_filter( $twitter_site, $presentation ){
// filter...
return $twitter_site;
}
- $twitter_site(строка)
- Twitter site account string.
- $presentation(Indexable_Presentation)
- The presentation of an indexable.
Где вызывается хук
wpseo_twitter_site
yoast/src/presenters/twitter/site-presenter.php 32
$twitter_site = \apply_filters( 'wpseo_twitter_site', $this->presentation->twitter_site, $this->presentation );