Description
Filter cvm_video_embed_settings
allows modification of embed settings right before the video is displayed. Does not apply for videos imported as posts compatible with your active WordPress theme.
Parameters
- $embed_settings
-
(array)(optional) The embed settings
- Default:None
- $post
-
(object)(optional) Post object for the current post being displayed.
- Default:None
- $video_details
-
(array)(optional) Array of video details retrieved from Vimeo.
- Default:None
Examples
Force all videos embedded automatically by the plugin to have the width set in plugin Settings page/Embed options. Will ignore the width setting set on post editing for the current post.
/** * Vimeo Video Post plugin - modify embed settings on the fly. * Hooked to cvm_video_embed_settings filter * * @param array $settings * @param object $post * @param array $video * @return array */ function my_embed_settings( $settings, $post, $video ){ $plugin_settings = cvm_get_player_settings(); $settings['width'] = $plugin_settings['width']; return $settings; } add_filter( 'cvm_video_embed_settings', 'my_embed_settings', 10, 3 );