wp_video_shortcode

SummerySummery

Builds the Video shortcode output.

Syntax

wp_video_shortcode( array $attr, string $content = '' )

DescriptionDescription

This implements the functionality of the Video Shortcode for displaying WordPress mp4s in a post.

ParametersParameters

$attr

(array) (Required) Attributes of the shortcode.

  • 'src'
    (string) URL to the source of the video file. Default empty.
  • 'height'
    (int) Height of the video embed in pixels. Default 360.
  • 'width'
    (int) Width of the video embed in pixels. Default $content_width or 640.
  • 'poster'
    (string) The 'poster' attribute for the <video> element. Default empty.
  • 'loop'
    (string) The 'loop' attribute for the <video> element. Default empty.
  • 'autoplay'
    (string) The 'autoplay' attribute for the <video> element. Default empty.
  • 'preload'
    (string) The 'preload' attribute for the <video> element. Default 'metadata'.
  • 'class'
    (string) The 'class' attribute for the <video> element. Default 'wp-video-shortcode'.

$content

(string) (Optional) Shortcode content.

Default value: ''

ReturnReturn

(string|void) HTML content to display video.

SourceSource

File: wp-includes/media.php


			

ChangelogChangelog

Changelog
Version Description
3.6.0 Introduced.
Scroll to Top