WP_Widget_Media_Video::get_instance_schema()

Get schema for properties of a widget instance (item).


Description Description


Return Return

(array) Schema for properties.


Top ↑

Source Source

File: wp-includes/widgets/class-wp-widget-media-video.php

	public function get_instance_schema() {
		$schema = array_merge(
			parent::get_instance_schema(),
			array(
				'preload' => array(
					'type' => 'string',
					'enum' => array( 'none', 'auto', 'metadata' ),
					'default' => 'metadata',
					'description' => __( 'Preload' ),
					'should_preview_update' => false,
				),
				'loop' => array(
					'type' => 'boolean',
					'default' => false,
					'description' => __( 'Loop' ),
					'should_preview_update' => false,
				),
				'content' => array(
					'type' => 'string',
					'default' => '',
					'sanitize_callback' => 'wp_kses_post',
					'description' => __( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ),
					'should_preview_update' => false,
				),
			)
		);

		foreach ( wp_get_video_extensions() as $video_extension ) {
			$schema[ $video_extension ] = array(
				'type' => 'string',
				'default' => '',
				'format' => 'uri',
				/* translators: %s: video extension */
				'description' => sprintf( __( 'URL to the %s video source file' ), $video_extension ),
			);
		}

		return $schema;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.8.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.