Helper::get_post_player_size( bool|int|\WP_Post $post )
Get the video embed size for the current post.
Description
Returns an array with keys "height" and "width" for the current video post.
Parameters
- $post
-
(Required) The WordPress post that should be processed.
Return
(array|bool) An array with structure ['width' => (int), 'height' => (int)] or false if the post was not imported by Vimeotheque.
Source
File: includes/libs/helper.class.php
public static function get_post_player_size( $post ){ $_post = self::get_video_post( $post ); if( $_post->is_video() ){ $options = $_post->get_embed_options(); $height = self::calculate_player_height( $options['aspect_ratio'], $options['width'] ); return [ 'width' => $options['width'], 'height' => $height ]; } return false; }