WordPress at a glance
function is not described

WP_Widget_Media_Audio::get_instance_schema() public WP 4.8.0

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

{} It's a method of the class: WP_Widget_Media_Audio{}

No Hooks.

Return

Array. Schema for properties.

Usage

$WP_Widget_Media_Audio = new WP_Widget_Media_Audio();
$WP_Widget_Media_Audio->get_instance_schema();

Notes

  • See: WP_REST_Controller::get_item_schema()
  • See: WP_REST_Controller::get_additional_fields()

Changelog

Since 4.8.0 Introduced.

Code of WP_Widget_Media_Audio::get_instance_schema() WP 5.7.2

<?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() );
}