WP_Widget_Media_Video::get_instance_schema
Get schema for properties of a widget instance (item).
Метод класса: WP_Widget_Media_Video{}
Хуков нет.
Возвращает
Массив. Schema for properties.
Использование
$WP_Widget_Media_Video = new WP_Widget_Media_Video(); $WP_Widget_Media_Video->get_instance_schema();
Заметки
- Смотрите: WP_REST_Controller::get_item_schema()
- Смотрите: WP_REST_Controller::get_additional_fields()
Список изменений
| С версии 4.8.0 | Введена. |
Код WP_Widget_Media_Video::get_instance_schema() WP Widget Media Video::get instance schema WP 6.9
public function get_instance_schema() {
$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 array_merge( $schema, parent::get_instance_schema() );
}