Embed::get_video_properties( string $video_url )
Get video properties.
Description
Retrieve the video properties for a given video URL.
Parameters
Name | Type | Required | Description |
---|---|---|---|
$video_url | string |
Required | Video URL. |
Return
(null|array) The video properties, or null.
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |
Source
includes/embed.php
public static function get_video_properties( $video_url ) { foreach ( self::$provider_match_masks as $provider => $match_mask ) { preg_match( $match_mask, $video_url, $matches ); if ( $matches ) { return [ 'provider' => $provider, 'video_id' => $matches[1], ]; } } return null; }
Used By
- includes/embed.php: Embed::get_embed_url()
- includes/widgets/video.php: Widget_Video::get_embed_params()
- includes/elements/section.php: Element_Section::before_render()