: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
var State = wp.media.controller.State,
l10n = wp.media.view.l10n,
* wp.media.controller.AudioDetails
* The controller for the Audio Details state
* @memberOf wp.media.controller
* @augments wp.media.controller.State
* @augments Backbone.Model
AudioDetails = State.extend(/** @lends wp.media.controller.AudioDetails.prototype */{
toolbar: 'audio-details',
title: l10n.audioDetailsTitle,
content: 'audio-details',
initialize: function( options ) {
this.media = options.media;
State.prototype.initialize.apply( this, arguments );
module.exports = AudioDetails;
* wp.media.controller.VideoDetails
* The controller for the Video Details state
* @memberOf wp.media.controller
* @augments wp.media.controller.State
* @augments Backbone.Model
var State = wp.media.controller.State,
l10n = wp.media.view.l10n,
VideoDetails = State.extend(/** @lends wp.media.controller.VideoDetails.prototype */{
toolbar: 'video-details',
title: l10n.videoDetailsTitle,
content: 'video-details',
initialize: function( options ) {
this.media = options.media;
State.prototype.initialize.apply( this, arguments );
module.exports = VideoDetails;
* wp.media.model.PostMedia
* Shared model class for audio and video. Updates the model after
* "Add Audio|Video Source" and "Replace Audio|Video" states return
* @memberOf wp.media.model
* @augments Backbone.Model
var PostMedia = Backbone.Model.extend(/** @lends wp.media.model.PostMedia.prototype */{
setSource: function( attachment ) {
this.attachment = attachment;
this.extension = attachment.get( 'filename' ).split('.').pop();
if ( this.get( 'src' ) && this.extension === this.get( 'src' ).split('.').pop() ) {
if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) {
this.set( this.extension, this.attachment.get( 'url' ) );
this.unset( this.extension );
changeAttachment: function( attachment ) {
this.setSource( attachment );
_.each( _.without( wp.media.view.settings.embedExts, this.extension ), function( ext ) {
module.exports = PostMedia;
var MediaDetails = wp.media.view.MediaDetails,
* wp.media.view.AudioDetails
* @memberOf wp.media.view
* @augments wp.media.view.MediaDetails
* @augments wp.media.view.Settings.AttachmentDisplay
* @augments wp.media.view.Settings
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
AudioDetails = MediaDetails.extend(/** @lends wp.media.view.AudioDetails.prototype */{
className: 'audio-details',
template: wp.template('audio-details'),
var audio = this.$('.wp-audio-shortcode');
if ( audio.find( 'source' ).length ) {
if ( audio.is(':hidden') ) {
this.media = MediaDetails.prepareSrc( audio.get(0) );
module.exports = AudioDetails;
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
* wp.media.view.MediaFrame.AudioDetails
* @memberOf wp.media.view.MediaFrame
* @augments wp.media.view.MediaFrame.MediaDetails
* @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame
* @augments wp.media.view.Frame
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
AudioDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.AudioDetails.prototype */{
content: 'audio-details',
toolbar: 'audio-details',
title: l10n.audioDetailsTitle,
initialize: function( options ) {
options.DetailsView = wp.media.view.AudioDetails;
options.cancelText = l10n.audioDetailsCancel;
options.addText = l10n.audioAddSourceTitle;
MediaDetails.prototype.initialize.call( this, options );
bindHandlers: function() {
MediaDetails.prototype.bindHandlers.apply( this, arguments );
this.on( 'toolbar:render:replace-audio', this.renderReplaceToolbar, this );
this.on( 'toolbar:render:add-audio-source', this.renderAddSourceToolbar, this );
createStates: function() {
new wp.media.controller.AudioDetails( {
title: l10n.audioReplaceTitle,
toolbar: 'replace-audio',
title: l10n.audioAddSourceTitle,
toolbar: 'add-audio-source',
module.exports = AudioDetails;
var Select = wp.media.view.MediaFrame.Select,
l10n = wp.media.view.l10n,
* wp.media.view.MediaFrame.MediaDetails
* @memberOf wp.media.view.MediaFrame
* @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame
* @augments wp.media.view.Frame
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
MediaDetails = Select.extend(/** @lends wp.media.view.MediaFrame.MediaDetails.prototype */{
content: 'media-details',
toolbar: 'media-details',
initialize: function( options ) {
this.DetailsView = options.DetailsView;
this.cancelText = options.cancelText;
this.addText = options.addText;
this.media = new wp.media.model.PostMedia( options.metadata );
this.options.selection = new wp.media.model.Selection( this.media.attachment, { multiple: false } );
Select.prototype.initialize.apply( this, arguments );
bindHandlers: function() {
var menu = this.defaults.menu;
Select.prototype.bindHandlers.apply( this, arguments );
this.on( 'menu:create:' + menu, this.createMenu, this );
this.on( 'content:render:' + menu, this.renderDetailsContent, this );
this.on( 'menu:render:' + menu, this.renderMenu, this );
this.on( 'toolbar:render:' + menu, this.renderDetailsToolbar, this );
renderDetailsContent: function() {
var view = new this.DetailsView({
model: this.state().media,
attachment: this.state().media.attachment
this.content.set( view );
renderMenu: function( view ) {
var lastState = this.lastState(),
previous = lastState && lastState.id,
frame.setState( previous );
separateCancel: new wp.media.View({
setPrimaryButton: function(text, handler) {
this.toolbar.set( new wp.media.view.Toolbar({
var controller = this.controller;
handler.call( this, controller, controller.state() );
// Restore and reset the default state.
controller.setState( controller.options.state );
renderDetailsToolbar: function() {
this.setPrimaryButton( l10n.update, function( controller, state ) {
state.trigger( 'update', controller.media.toJSON() );
renderReplaceToolbar: function() {
this.setPrimaryButton( l10n.replace, function( controller, state ) {
var attachment = state.get( 'selection' ).single();
controller.media.changeAttachment( attachment );
state.trigger( 'replace', controller.media.toJSON() );
renderAddSourceToolbar: function() {
this.setPrimaryButton( this.addText, function( controller, state ) {
var attachment = state.get( 'selection' ).single();
controller.media.setSource( attachment );
state.trigger( 'add-source', controller.media.toJSON() );
module.exports = MediaDetails;
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
MediaLibrary = wp.media.controller.MediaLibrary,
l10n = wp.media.view.l10n,
* wp.media.view.MediaFrame.VideoDetails
* @memberOf wp.media.view.MediaFrame
* @augments wp.media.view.MediaFrame.MediaDetails
* @augments wp.media.view.MediaFrame.Select
* @augments wp.media.view.MediaFrame
* @augments wp.media.view.Frame
* @augments wp.media.View
* @augments wp.Backbone.View
* @augments Backbone.View
* @mixes wp.media.controller.StateMachine
VideoDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.VideoDetails.prototype */{
content: 'video-details',
toolbar: 'video-details',
title: l10n.videoDetailsTitle,
initialize: function( options ) {
options.DetailsView = wp.media.view.VideoDetails;
options.cancelText = l10n.videoDetailsCancel;
options.addText = l10n.videoAddSourceTitle;
MediaDetails.prototype.initialize.call( this, options );
bindHandlers: function() {
MediaDetails.prototype.bindHandlers.apply( this, arguments );
this.on( 'toolbar:render:replace-video', this.renderReplaceToolbar, this );
this.on( 'toolbar:render:add-video-source', this.renderAddSourceToolbar, this );
this.on( 'toolbar:render:select-poster-image', this.renderSelectPosterImageToolbar, this );
this.on( 'toolbar:render:add-track', this.renderAddTrackToolbar, this );
createStates: function() {
new wp.media.controller.VideoDetails({
title: l10n.videoReplaceTitle,
toolbar: 'replace-video',
title: l10n.videoAddSourceTitle,
toolbar: 'add-video-source',
id: 'select-poster-image',
title: l10n.videoSelectPosterImageTitle,
toolbar: 'select-poster-image',
title: l10n.videoAddTrackTitle,
renderSelectPosterImageToolbar: function() {
this.setPrimaryButton( l10n.videoSelectPosterImageTitle, function( controller, state ) {
var urls = [], attachment = state.get( 'selection' ).single();
controller.media.set( 'poster', attachment.get( 'url' ) );
state.trigger( 'set-poster-image', controller.media.toJSON() );