Elementor Code Reference
  • Developers
  • Code Reference
  • Docs
  • Blog
  • Account
  • Developers
  • Code Reference
  • Docs
  • Blog
  • Account

Embed::get_video_properties

Embed::get_video_properties( string $video_url )

Get video properties.


Description

Retrieve the video properties for a given video URL.


Parameters

Parameters
Name Type Required Description
$video_url string Required Video URL.

Return

(null|array) The video properties, or null.


Changelog

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()
Elementor Code Reference
  • Code Reference
  • Elementor Hooks
    • PHP Hooks
    • JS Hooks
  • Elementor Classes
  • Elementor Methods
  • Elementor Functions
Developer Resources

Visit the official Developer Resources to learn how to extend Elementor.

Get Involved

Visit Elementor GitHub repository to contribute code or suggest new ideas.

  • Contact
  • About Us
  • Terms of Service
  • Privacy Policy
  • Template Library
  • Features
  • Theme Builder
  • Get Pro
Theme by Pojo.me
//Made in Elementor Page Builder
Enter your email and be the first to learn about new updates and features.
No thanks, I just want to download Elementor