WP_Widget_Media_Audio::get_instance_schema

Advertisement

Summery Summery

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

Syntax Syntax

WP_Widget_Media_Audio::get_instance_schema()

Return Return

(array) Schema for properties.

Source Source

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

	public function get_instance_schema() {
		$schema = array(
			'preload' => array(
				'type'        => 'string',
				'enum'        => array( 'none', 'auto', 'metadata' ),
				'default'     => 'none',
				'description' => __( 'Preload' ),
			),
			'loop'    => array(
				'type'        => 'boolean',
				'default'     => false,
				'description' => __( 'Loop' ),
			),
		);

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

		return array_merge( $schema, parent::get_instance_schema() );
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.8.0 Introduced.

See also See also

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.