- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-media-audio.php
r41640 r42343 23 23 */ 24 24 public function __construct() { 25 parent::__construct( 'media_audio', __( 'Audio' ), array( 26 'description' => __( 'Displays an audio player.' ), 27 'mime_type' => 'audio', 28 ) ); 29 30 $this->l10n = array_merge( $this->l10n, array( 31 'no_media_selected' => __( 'No audio selected' ), 32 'add_media' => _x( 'Add Audio', 'label for button in the audio widget' ), 33 'replace_media' => _x( 'Replace Audio', 'label for button in the audio widget; should preferably not be longer than ~13 characters long' ), 34 'edit_media' => _x( 'Edit Audio', 'label for button in the audio widget; should preferably not be longer than ~13 characters long' ), 35 'missing_attachment' => sprintf( 36 /* translators: %s: URL to media library */ 37 __( 'We can’t find that audio file. Check your <a href="%s">media library</a> and make sure it wasn’t deleted.' ), 38 esc_url( admin_url( 'upload.php' ) ) 39 ), 40 /* translators: %d: widget count */ 41 'media_library_state_multi' => _n_noop( 'Audio Widget (%d)', 'Audio Widget (%d)' ), 42 'media_library_state_single' => __( 'Audio Widget' ), 43 'unsupported_file_type' => __( 'Looks like this isn’t the correct kind of file. Please link to an audio file instead.' ), 44 ) ); 25 parent::__construct( 26 'media_audio', __( 'Audio' ), array( 27 'description' => __( 'Displays an audio player.' ), 28 'mime_type' => 'audio', 29 ) 30 ); 31 32 $this->l10n = array_merge( 33 $this->l10n, array( 34 'no_media_selected' => __( 'No audio selected' ), 35 'add_media' => _x( 'Add Audio', 'label for button in the audio widget' ), 36 'replace_media' => _x( 'Replace Audio', 'label for button in the audio widget; should preferably not be longer than ~13 characters long' ), 37 'edit_media' => _x( 'Edit Audio', 'label for button in the audio widget; should preferably not be longer than ~13 characters long' ), 38 'missing_attachment' => sprintf( 39 /* translators: %s: URL to media library */ 40 __( 'We can’t find that audio file. Check your <a href="%s">media library</a> and make sure it wasn’t deleted.' ), 41 esc_url( admin_url( 'upload.php' ) ) 42 ), 43 /* translators: %d: widget count */ 44 'media_library_state_multi' => _n_noop( 'Audio Widget (%d)', 'Audio Widget (%d)' ), 45 'media_library_state_single' => __( 'Audio Widget' ), 46 'unsupported_file_type' => __( 'Looks like this isn’t the correct kind of file. Please link to an audio file instead.' ), 47 ) 48 ); 45 49 } 46 50 … … 60 64 array( 61 65 'preload' => array( 62 'type' => 'string',63 'enum' => array( 'none', 'auto', 'metadata' ),64 'default' => 'none',66 'type' => 'string', 67 'enum' => array( 'none', 'auto', 'metadata' ), 68 'default' => 'none', 65 69 'description' => __( 'Preload' ), 66 70 ), 67 'loop' => array(68 'type' => 'boolean',69 'default' => false,71 'loop' => array( 72 'type' => 'boolean', 73 'default' => false, 70 74 'description' => __( 'Loop' ), 71 75 ), … … 75 79 foreach ( wp_get_audio_extensions() as $audio_extension ) { 76 80 $schema[ $audio_extension ] = array( 77 'type' => 'string',78 'default' => '',79 'format' => 'uri',81 'type' => 'string', 82 'default' => '', 83 'format' => 'uri', 80 84 /* translators: %s: audio extension */ 81 85 'description' => sprintf( __( 'URL to the %s audio source file' ), $audio_extension ), … … 95 99 */ 96 100 public function render_media( $instance ) { 97 $instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance );101 $instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance ); 98 102 $attachment = null; 99 103 … … 193 197 </div> 194 198 <# } else if ( data.model && data.model.src ) { #> 195 <?php wp_underscore_audio_template() ?>199 <?php wp_underscore_audio_template(); ?> 196 200 <# } #> 197 201 </script>
Note: See TracChangeset
for help on using the changeset viewer.