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