- 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-video.php
r41933 r42343 23 23 */ 24 24 public function __construct() { 25 parent::__construct( 'media_video', __( 'Video' ), array( 26 'description' => __( 'Displays a video from the media library or from YouTube, Vimeo, or another provider.' ), 27 'mime_type' => 'video', 28 ) ); 29 30 $this->l10n = array_merge( $this->l10n, array( 31 'no_media_selected' => __( 'No video selected' ), 32 'add_media' => _x( 'Add Video', 'label for button in the video widget' ), 33 'replace_media' => _x( 'Replace Video', 'label for button in the video widget; should preferably not be longer than ~13 characters long' ), 34 'edit_media' => _x( 'Edit Video', 'label for button in the video 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 video. 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( 'Video Widget (%d)', 'Video Widget (%d)' ), 42 'media_library_state_single' => __( 'Video Widget' ), 43 /* translators: %s: a list of valid video file extensions */ 44 'unsupported_file_type' => sprintf( __( 'Sorry, we can’t load the video at the supplied URL. Please check that the URL is for a supported video file (%s) or stream (e.g. YouTube and Vimeo).' ), '<code>.' . implode( '</code>, <code>.', wp_get_video_extensions() ) . '</code>' ), 45 ) ); 25 parent::__construct( 26 'media_video', __( 'Video' ), array( 27 'description' => __( 'Displays a video from the media library or from YouTube, Vimeo, or another provider.' ), 28 'mime_type' => 'video', 29 ) 30 ); 31 32 $this->l10n = array_merge( 33 $this->l10n, array( 34 'no_media_selected' => __( 'No video selected' ), 35 'add_media' => _x( 'Add Video', 'label for button in the video widget' ), 36 'replace_media' => _x( 'Replace Video', 'label for button in the video widget; should preferably not be longer than ~13 characters long' ), 37 'edit_media' => _x( 'Edit Video', 'label for button in the video 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 video. 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( 'Video Widget (%d)', 'Video Widget (%d)' ), 45 'media_library_state_single' => __( 'Video Widget' ), 46 /* translators: %s: a list of valid video file extensions */ 47 'unsupported_file_type' => sprintf( __( 'Sorry, we can’t load the video at the supplied URL. Please check that the URL is for a supported video file (%s) or stream (e.g. YouTube and Vimeo).' ), '<code>.' . implode( '</code>, <code>.', wp_get_video_extensions() ) . '</code>' ), 48 ) 49 ); 46 50 } 47 51 … … 61 65 array( 62 66 'preload' => array( 63 'type' => 'string',64 'enum' => array( 'none', 'auto', 'metadata' ),65 'default' => 'metadata',66 'description' => __( 'Preload' ),67 'type' => 'string', 68 'enum' => array( 'none', 'auto', 'metadata' ), 69 'default' => 'metadata', 70 'description' => __( 'Preload' ), 67 71 'should_preview_update' => false, 68 72 ), 69 'loop' => array(70 'type' => 'boolean',71 'default' => false,72 'description' => __( 'Loop' ),73 'loop' => array( 74 'type' => 'boolean', 75 'default' => false, 76 'description' => __( 'Loop' ), 73 77 'should_preview_update' => false, 74 78 ), 75 79 'content' => array( 76 'type' => 'string',77 'default' => '',78 'sanitize_callback' => 'wp_kses_post',79 'description' => __( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ),80 'type' => 'string', 81 'default' => '', 82 'sanitize_callback' => 'wp_kses_post', 83 'description' => __( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ), 80 84 'should_preview_update' => false, 81 85 ), … … 85 89 foreach ( wp_get_video_extensions() as $video_extension ) { 86 90 $schema[ $video_extension ] = array( 87 'type' => 'string',88 'default' => '',89 'format' => 'uri',91 'type' => 'string', 92 'default' => '', 93 'format' => 'uri', 90 94 /* translators: %s: video extension */ 91 95 'description' => sprintf( __( 'URL to the %s video source file' ), $video_extension ), … … 106 110 */ 107 111 public function render_media( $instance ) { 108 $instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance );112 $instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance ); 109 113 $attachment = null; 110 114 … … 244 248 </a> 245 249 <# } else if ( data.model.src ) { #> 246 <?php wp_underscore_video_template() ?>250 <?php wp_underscore_video_template(); ?> 247 251 <# } #> 248 252 </script>
Note: See TracChangeset
for help on using the changeset viewer.