Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js
File: media-editor.js
// Ignore the rest of the match object.
[500] Fix | Delete
shortcode = shortcode.shortcode;
[501] Fix | Delete
[502] Fix | Delete
if ( _.isUndefined( shortcode.get('id') ) && ! _.isUndefined( defaultPostId ) ) {
[503] Fix | Delete
shortcode.set( 'id', defaultPostId );
[504] Fix | Delete
}
[505] Fix | Delete
[506] Fix | Delete
attachments = this.attachments( shortcode );
[507] Fix | Delete
[508] Fix | Delete
selection = new wp.media.model.Selection( attachments.models, {
[509] Fix | Delete
props: attachments.props.toJSON(),
[510] Fix | Delete
multiple: true
[511] Fix | Delete
});
[512] Fix | Delete
[513] Fix | Delete
selection[ this.tag ] = attachments[ this.tag ];
[514] Fix | Delete
[515] Fix | Delete
// Fetch the query's attachments, and then break ties from the
[516] Fix | Delete
// query to allow for sorting.
[517] Fix | Delete
selection.more().done( function() {
[518] Fix | Delete
// Break ties with the query.
[519] Fix | Delete
selection.props.set({ query: false });
[520] Fix | Delete
selection.unmirror();
[521] Fix | Delete
selection.props.unset('orderby');
[522] Fix | Delete
});
[523] Fix | Delete
[524] Fix | Delete
// Destroy the previous gallery frame.
[525] Fix | Delete
if ( this.frame ) {
[526] Fix | Delete
this.frame.dispose();
[527] Fix | Delete
}
[528] Fix | Delete
[529] Fix | Delete
if ( shortcode.attrs.named.type && 'video' === shortcode.attrs.named.type ) {
[530] Fix | Delete
state = 'video-' + this.tag + '-edit';
[531] Fix | Delete
} else {
[532] Fix | Delete
state = this.tag + '-edit';
[533] Fix | Delete
}
[534] Fix | Delete
[535] Fix | Delete
// Store the current frame.
[536] Fix | Delete
this.frame = wp.media({
[537] Fix | Delete
frame: 'post',
[538] Fix | Delete
state: state,
[539] Fix | Delete
title: this.editTitle,
[540] Fix | Delete
editing: true,
[541] Fix | Delete
multiple: true,
[542] Fix | Delete
selection: selection
[543] Fix | Delete
}).open();
[544] Fix | Delete
[545] Fix | Delete
return this.frame;
[546] Fix | Delete
},
[547] Fix | Delete
[548] Fix | Delete
setDefaults: function( attrs ) {
[549] Fix | Delete
var self = this;
[550] Fix | Delete
// Remove default attributes from the shortcode.
[551] Fix | Delete
_.each( this.defaults, function( value, key ) {
[552] Fix | Delete
attrs[ key ] = self.coerce( attrs, key );
[553] Fix | Delete
if ( value === attrs[ key ] ) {
[554] Fix | Delete
delete attrs[ key ];
[555] Fix | Delete
}
[556] Fix | Delete
});
[557] Fix | Delete
[558] Fix | Delete
return attrs;
[559] Fix | Delete
}
[560] Fix | Delete
}, attributes );
[561] Fix | Delete
};
[562] Fix | Delete
[563] Fix | Delete
wp.media._galleryDefaults = {
[564] Fix | Delete
itemtag: 'dl',
[565] Fix | Delete
icontag: 'dt',
[566] Fix | Delete
captiontag: 'dd',
[567] Fix | Delete
columns: '3',
[568] Fix | Delete
link: 'post',
[569] Fix | Delete
size: 'thumbnail',
[570] Fix | Delete
order: 'ASC',
[571] Fix | Delete
id: wp.media.view.settings.post && wp.media.view.settings.post.id,
[572] Fix | Delete
orderby : 'menu_order ID'
[573] Fix | Delete
};
[574] Fix | Delete
[575] Fix | Delete
if ( wp.media.view.settings.galleryDefaults ) {
[576] Fix | Delete
wp.media.galleryDefaults = _.extend( {}, wp.media._galleryDefaults, wp.media.view.settings.galleryDefaults );
[577] Fix | Delete
} else {
[578] Fix | Delete
wp.media.galleryDefaults = wp.media._galleryDefaults;
[579] Fix | Delete
}
[580] Fix | Delete
[581] Fix | Delete
wp.media.gallery = new wp.media.collection({
[582] Fix | Delete
tag: 'gallery',
[583] Fix | Delete
type : 'image',
[584] Fix | Delete
editTitle : wp.media.view.l10n.editGalleryTitle,
[585] Fix | Delete
defaults : wp.media.galleryDefaults,
[586] Fix | Delete
[587] Fix | Delete
setDefaults: function( attrs ) {
[588] Fix | Delete
var self = this, changed = ! _.isEqual( wp.media.galleryDefaults, wp.media._galleryDefaults );
[589] Fix | Delete
_.each( this.defaults, function( value, key ) {
[590] Fix | Delete
attrs[ key ] = self.coerce( attrs, key );
[591] Fix | Delete
if ( value === attrs[ key ] && ( ! changed || value === wp.media._galleryDefaults[ key ] ) ) {
[592] Fix | Delete
delete attrs[ key ];
[593] Fix | Delete
}
[594] Fix | Delete
} );
[595] Fix | Delete
return attrs;
[596] Fix | Delete
}
[597] Fix | Delete
});
[598] Fix | Delete
[599] Fix | Delete
/**
[600] Fix | Delete
* @namespace wp.media.featuredImage
[601] Fix | Delete
* @memberOf wp.media
[602] Fix | Delete
*/
[603] Fix | Delete
wp.media.featuredImage = {
[604] Fix | Delete
/**
[605] Fix | Delete
* Get the featured image post ID
[606] Fix | Delete
*
[607] Fix | Delete
* @return {wp.media.view.settings.post.featuredImageId|number}
[608] Fix | Delete
*/
[609] Fix | Delete
get: function() {
[610] Fix | Delete
return wp.media.view.settings.post.featuredImageId;
[611] Fix | Delete
},
[612] Fix | Delete
/**
[613] Fix | Delete
* Sets the featured image ID property and sets the HTML in the post meta box to the new featured image.
[614] Fix | Delete
*
[615] Fix | Delete
* @param {number} id The post ID of the featured image, or -1 to unset it.
[616] Fix | Delete
*/
[617] Fix | Delete
set: function( id ) {
[618] Fix | Delete
var settings = wp.media.view.settings;
[619] Fix | Delete
[620] Fix | Delete
settings.post.featuredImageId = id;
[621] Fix | Delete
[622] Fix | Delete
wp.media.post( 'get-post-thumbnail-html', {
[623] Fix | Delete
post_id: settings.post.id,
[624] Fix | Delete
thumbnail_id: settings.post.featuredImageId,
[625] Fix | Delete
_wpnonce: settings.post.nonce
[626] Fix | Delete
}).done( function( html ) {
[627] Fix | Delete
if ( '0' === html ) {
[628] Fix | Delete
window.alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) );
[629] Fix | Delete
return;
[630] Fix | Delete
}
[631] Fix | Delete
$( '.inside', '#postimagediv' ).html( html );
[632] Fix | Delete
});
[633] Fix | Delete
},
[634] Fix | Delete
/**
[635] Fix | Delete
* Remove the featured image id, save the post thumbnail data and
[636] Fix | Delete
* set the HTML in the post meta box to no featured image.
[637] Fix | Delete
*/
[638] Fix | Delete
remove: function() {
[639] Fix | Delete
wp.media.featuredImage.set( -1 );
[640] Fix | Delete
},
[641] Fix | Delete
/**
[642] Fix | Delete
* The Featured Image workflow
[643] Fix | Delete
*
[644] Fix | Delete
* @this wp.media.featuredImage
[645] Fix | Delete
*
[646] Fix | Delete
* @return {wp.media.view.MediaFrame.Select} A media workflow.
[647] Fix | Delete
*/
[648] Fix | Delete
frame: function() {
[649] Fix | Delete
if ( this._frame ) {
[650] Fix | Delete
wp.media.frame = this._frame;
[651] Fix | Delete
return this._frame;
[652] Fix | Delete
}
[653] Fix | Delete
[654] Fix | Delete
this._frame = wp.media({
[655] Fix | Delete
state: 'featured-image',
[656] Fix | Delete
states: [ new wp.media.controller.FeaturedImage() , new wp.media.controller.EditImage() ]
[657] Fix | Delete
});
[658] Fix | Delete
[659] Fix | Delete
this._frame.on( 'toolbar:create:featured-image', function( toolbar ) {
[660] Fix | Delete
/**
[661] Fix | Delete
* @this wp.media.view.MediaFrame.Select
[662] Fix | Delete
*/
[663] Fix | Delete
this.createSelectToolbar( toolbar, {
[664] Fix | Delete
text: wp.media.view.l10n.setFeaturedImage
[665] Fix | Delete
});
[666] Fix | Delete
}, this._frame );
[667] Fix | Delete
[668] Fix | Delete
this._frame.on( 'content:render:edit-image', function() {
[669] Fix | Delete
var selection = this.state('featured-image').get('selection'),
[670] Fix | Delete
view = new wp.media.view.EditImage( { model: selection.single(), controller: this } ).render();
[671] Fix | Delete
[672] Fix | Delete
this.content.set( view );
[673] Fix | Delete
[674] Fix | Delete
// After bringing in the frame, load the actual editor via an Ajax call.
[675] Fix | Delete
view.loadEditor();
[676] Fix | Delete
[677] Fix | Delete
}, this._frame );
[678] Fix | Delete
[679] Fix | Delete
this._frame.state('featured-image').on( 'select', this.select );
[680] Fix | Delete
return this._frame;
[681] Fix | Delete
},
[682] Fix | Delete
/**
[683] Fix | Delete
* 'select' callback for Featured Image workflow, triggered when
[684] Fix | Delete
* the 'Set Featured Image' button is clicked in the media modal.
[685] Fix | Delete
*
[686] Fix | Delete
* @this wp.media.controller.FeaturedImage
[687] Fix | Delete
*/
[688] Fix | Delete
select: function() {
[689] Fix | Delete
var selection = this.get('selection').single();
[690] Fix | Delete
[691] Fix | Delete
if ( ! wp.media.view.settings.post.featuredImageId ) {
[692] Fix | Delete
return;
[693] Fix | Delete
}
[694] Fix | Delete
[695] Fix | Delete
wp.media.featuredImage.set( selection ? selection.id : -1 );
[696] Fix | Delete
},
[697] Fix | Delete
/**
[698] Fix | Delete
* Open the content media manager to the 'featured image' tab when
[699] Fix | Delete
* the post thumbnail is clicked.
[700] Fix | Delete
*
[701] Fix | Delete
* Update the featured image id when the 'remove' link is clicked.
[702] Fix | Delete
*/
[703] Fix | Delete
init: function() {
[704] Fix | Delete
$('#postimagediv').on( 'click', '#set-post-thumbnail', function( event ) {
[705] Fix | Delete
event.preventDefault();
[706] Fix | Delete
// Stop propagation to prevent thickbox from activating.
[707] Fix | Delete
event.stopPropagation();
[708] Fix | Delete
[709] Fix | Delete
wp.media.featuredImage.frame().open();
[710] Fix | Delete
}).on( 'click', '#remove-post-thumbnail', function() {
[711] Fix | Delete
wp.media.featuredImage.remove();
[712] Fix | Delete
return false;
[713] Fix | Delete
});
[714] Fix | Delete
}
[715] Fix | Delete
};
[716] Fix | Delete
[717] Fix | Delete
$( wp.media.featuredImage.init );
[718] Fix | Delete
[719] Fix | Delete
/** @namespace wp.media.editor */
[720] Fix | Delete
wp.media.editor = {
[721] Fix | Delete
/**
[722] Fix | Delete
* Send content to the editor
[723] Fix | Delete
*
[724] Fix | Delete
* @param {string} html Content to send to the editor
[725] Fix | Delete
*/
[726] Fix | Delete
insert: function( html ) {
[727] Fix | Delete
var editor, wpActiveEditor,
[728] Fix | Delete
hasTinymce = ! _.isUndefined( window.tinymce ),
[729] Fix | Delete
hasQuicktags = ! _.isUndefined( window.QTags );
[730] Fix | Delete
[731] Fix | Delete
if ( this.activeEditor ) {
[732] Fix | Delete
wpActiveEditor = window.wpActiveEditor = this.activeEditor;
[733] Fix | Delete
} else {
[734] Fix | Delete
wpActiveEditor = window.wpActiveEditor;
[735] Fix | Delete
}
[736] Fix | Delete
[737] Fix | Delete
/*
[738] Fix | Delete
* Delegate to the global `send_to_editor` if it exists.
[739] Fix | Delete
* This attempts to play nice with any themes/plugins
[740] Fix | Delete
* that have overridden the insert functionality.
[741] Fix | Delete
*/
[742] Fix | Delete
if ( window.send_to_editor ) {
[743] Fix | Delete
return window.send_to_editor.apply( this, arguments );
[744] Fix | Delete
}
[745] Fix | Delete
[746] Fix | Delete
if ( ! wpActiveEditor ) {
[747] Fix | Delete
if ( hasTinymce && tinymce.activeEditor ) {
[748] Fix | Delete
editor = tinymce.activeEditor;
[749] Fix | Delete
wpActiveEditor = window.wpActiveEditor = editor.id;
[750] Fix | Delete
} else if ( ! hasQuicktags ) {
[751] Fix | Delete
return false;
[752] Fix | Delete
}
[753] Fix | Delete
} else if ( hasTinymce ) {
[754] Fix | Delete
editor = tinymce.get( wpActiveEditor );
[755] Fix | Delete
}
[756] Fix | Delete
[757] Fix | Delete
if ( editor && ! editor.isHidden() ) {
[758] Fix | Delete
editor.execCommand( 'mceInsertContent', false, html );
[759] Fix | Delete
} else if ( hasQuicktags ) {
[760] Fix | Delete
QTags.insertContent( html );
[761] Fix | Delete
} else {
[762] Fix | Delete
document.getElementById( wpActiveEditor ).value += html;
[763] Fix | Delete
}
[764] Fix | Delete
[765] Fix | Delete
// If the old thickbox remove function exists, call it in case
[766] Fix | Delete
// a theme/plugin overloaded it.
[767] Fix | Delete
if ( window.tb_remove ) {
[768] Fix | Delete
try { window.tb_remove(); } catch( e ) {}
[769] Fix | Delete
}
[770] Fix | Delete
},
[771] Fix | Delete
[772] Fix | Delete
/**
[773] Fix | Delete
* Setup 'workflow' and add to the 'workflows' cache. 'open' can
[774] Fix | Delete
* subsequently be called upon it.
[775] Fix | Delete
*
[776] Fix | Delete
* @param {string} id A slug used to identify the workflow.
[777] Fix | Delete
* @param {Object} [options={}]
[778] Fix | Delete
*
[779] Fix | Delete
* @this wp.media.editor
[780] Fix | Delete
*
[781] Fix | Delete
* @return {wp.media.view.MediaFrame.Select} A media workflow.
[782] Fix | Delete
*/
[783] Fix | Delete
add: function( id, options ) {
[784] Fix | Delete
var workflow = this.get( id );
[785] Fix | Delete
[786] Fix | Delete
// Only add once: if exists return existing.
[787] Fix | Delete
if ( workflow ) {
[788] Fix | Delete
return workflow;
[789] Fix | Delete
}
[790] Fix | Delete
[791] Fix | Delete
workflow = workflows[ id ] = wp.media( _.defaults( options || {}, {
[792] Fix | Delete
frame: 'post',
[793] Fix | Delete
state: 'insert',
[794] Fix | Delete
title: wp.media.view.l10n.addMedia,
[795] Fix | Delete
multiple: true
[796] Fix | Delete
} ) );
[797] Fix | Delete
[798] Fix | Delete
workflow.on( 'insert', function( selection ) {
[799] Fix | Delete
var state = workflow.state();
[800] Fix | Delete
[801] Fix | Delete
selection = selection || state.get('selection');
[802] Fix | Delete
[803] Fix | Delete
if ( ! selection ) {
[804] Fix | Delete
return;
[805] Fix | Delete
}
[806] Fix | Delete
[807] Fix | Delete
$.when.apply( $, selection.map( function( attachment ) {
[808] Fix | Delete
var display = state.display( attachment ).toJSON();
[809] Fix | Delete
/**
[810] Fix | Delete
* @this wp.media.editor
[811] Fix | Delete
*/
[812] Fix | Delete
return this.send.attachment( display, attachment.toJSON() );
[813] Fix | Delete
}, this ) ).done( function() {
[814] Fix | Delete
wp.media.editor.insert( _.toArray( arguments ).join('\n\n') );
[815] Fix | Delete
});
[816] Fix | Delete
}, this );
[817] Fix | Delete
[818] Fix | Delete
workflow.state('gallery-edit').on( 'update', function( selection ) {
[819] Fix | Delete
/**
[820] Fix | Delete
* @this wp.media.editor
[821] Fix | Delete
*/
[822] Fix | Delete
this.insert( wp.media.gallery.shortcode( selection ).string() );
[823] Fix | Delete
}, this );
[824] Fix | Delete
[825] Fix | Delete
workflow.state('playlist-edit').on( 'update', function( selection ) {
[826] Fix | Delete
/**
[827] Fix | Delete
* @this wp.media.editor
[828] Fix | Delete
*/
[829] Fix | Delete
this.insert( wp.media.playlist.shortcode( selection ).string() );
[830] Fix | Delete
}, this );
[831] Fix | Delete
[832] Fix | Delete
workflow.state('video-playlist-edit').on( 'update', function( selection ) {
[833] Fix | Delete
/**
[834] Fix | Delete
* @this wp.media.editor
[835] Fix | Delete
*/
[836] Fix | Delete
this.insert( wp.media.playlist.shortcode( selection ).string() );
[837] Fix | Delete
}, this );
[838] Fix | Delete
[839] Fix | Delete
workflow.state('embed').on( 'select', function() {
[840] Fix | Delete
/**
[841] Fix | Delete
* @this wp.media.editor
[842] Fix | Delete
*/
[843] Fix | Delete
var state = workflow.state(),
[844] Fix | Delete
type = state.get('type'),
[845] Fix | Delete
embed = state.props.toJSON();
[846] Fix | Delete
[847] Fix | Delete
embed.url = embed.url || '';
[848] Fix | Delete
[849] Fix | Delete
if ( 'link' === type ) {
[850] Fix | Delete
_.defaults( embed, {
[851] Fix | Delete
linkText: embed.url,
[852] Fix | Delete
linkUrl: embed.url
[853] Fix | Delete
});
[854] Fix | Delete
[855] Fix | Delete
this.send.link( embed ).done( function( resp ) {
[856] Fix | Delete
wp.media.editor.insert( resp );
[857] Fix | Delete
});
[858] Fix | Delete
[859] Fix | Delete
} else if ( 'image' === type ) {
[860] Fix | Delete
_.defaults( embed, {
[861] Fix | Delete
title: embed.url,
[862] Fix | Delete
linkUrl: '',
[863] Fix | Delete
align: 'none',
[864] Fix | Delete
link: 'none'
[865] Fix | Delete
});
[866] Fix | Delete
[867] Fix | Delete
if ( 'none' === embed.link ) {
[868] Fix | Delete
embed.linkUrl = '';
[869] Fix | Delete
} else if ( 'file' === embed.link ) {
[870] Fix | Delete
embed.linkUrl = embed.url;
[871] Fix | Delete
}
[872] Fix | Delete
[873] Fix | Delete
this.insert( wp.media.string.image( embed ) );
[874] Fix | Delete
}
[875] Fix | Delete
}, this );
[876] Fix | Delete
[877] Fix | Delete
workflow.state('featured-image').on( 'select', wp.media.featuredImage.select );
[878] Fix | Delete
workflow.setState( workflow.options.state );
[879] Fix | Delete
return workflow;
[880] Fix | Delete
},
[881] Fix | Delete
/**
[882] Fix | Delete
* Determines the proper current workflow id
[883] Fix | Delete
*
[884] Fix | Delete
* @param {string} [id=''] A slug used to identify the workflow.
[885] Fix | Delete
*
[886] Fix | Delete
* @return {wpActiveEditor|string|tinymce.activeEditor.id}
[887] Fix | Delete
*/
[888] Fix | Delete
id: function( id ) {
[889] Fix | Delete
if ( id ) {
[890] Fix | Delete
return id;
[891] Fix | Delete
}
[892] Fix | Delete
[893] Fix | Delete
// If an empty `id` is provided, default to `wpActiveEditor`.
[894] Fix | Delete
id = window.wpActiveEditor;
[895] Fix | Delete
[896] Fix | Delete
// If that doesn't work, fall back to `tinymce.activeEditor.id`.
[897] Fix | Delete
if ( ! id && ! _.isUndefined( window.tinymce ) && tinymce.activeEditor ) {
[898] Fix | Delete
id = tinymce.activeEditor.id;
[899] Fix | Delete
}
[900] Fix | Delete
[901] Fix | Delete
// Last but not least, fall back to the empty string.
[902] Fix | Delete
id = id || '';
[903] Fix | Delete
return id;
[904] Fix | Delete
},
[905] Fix | Delete
/**
[906] Fix | Delete
* Return the workflow specified by id
[907] Fix | Delete
*
[908] Fix | Delete
* @param {string} id A slug used to identify the workflow.
[909] Fix | Delete
*
[910] Fix | Delete
* @this wp.media.editor
[911] Fix | Delete
*
[912] Fix | Delete
* @return {wp.media.view.MediaFrame} A media workflow.
[913] Fix | Delete
*/
[914] Fix | Delete
get: function( id ) {
[915] Fix | Delete
id = this.id( id );
[916] Fix | Delete
return workflows[ id ];
[917] Fix | Delete
},
[918] Fix | Delete
/**
[919] Fix | Delete
* Remove the workflow represented by id from the workflow cache
[920] Fix | Delete
*
[921] Fix | Delete
* @param {string} id A slug used to identify the workflow.
[922] Fix | Delete
*
[923] Fix | Delete
* @this wp.media.editor
[924] Fix | Delete
*/
[925] Fix | Delete
remove: function( id ) {
[926] Fix | Delete
id = this.id( id );
[927] Fix | Delete
delete workflows[ id ];
[928] Fix | Delete
},
[929] Fix | Delete
/** @namespace wp.media.editor.send */
[930] Fix | Delete
send: {
[931] Fix | Delete
/**
[932] Fix | Delete
* Called when sending an attachment to the editor
[933] Fix | Delete
* from the medial modal.
[934] Fix | Delete
*
[935] Fix | Delete
* @param {Object} props Attachment details (align, link, size, etc).
[936] Fix | Delete
* @param {Object} attachment The attachment object, media version of Post.
[937] Fix | Delete
* @return {Promise}
[938] Fix | Delete
*/
[939] Fix | Delete
attachment: function( props, attachment ) {
[940] Fix | Delete
var caption = attachment.caption,
[941] Fix | Delete
options, html;
[942] Fix | Delete
[943] Fix | Delete
// If captions are disabled, clear the caption.
[944] Fix | Delete
if ( ! wp.media.view.settings.captions ) {
[945] Fix | Delete
delete attachment.caption;
[946] Fix | Delete
}
[947] Fix | Delete
[948] Fix | Delete
props = wp.media.string.props( props, attachment );
[949] Fix | Delete
[950] Fix | Delete
options = {
[951] Fix | Delete
id: attachment.id,
[952] Fix | Delete
post_content: attachment.description,
[953] Fix | Delete
post_excerpt: caption
[954] Fix | Delete
};
[955] Fix | Delete
[956] Fix | Delete
if ( props.linkUrl ) {
[957] Fix | Delete
options.url = props.linkUrl;
[958] Fix | Delete
}
[959] Fix | Delete
[960] Fix | Delete
if ( 'image' === attachment.type ) {
[961] Fix | Delete
html = wp.media.string.image( props );
[962] Fix | Delete
[963] Fix | Delete
_.each({
[964] Fix | Delete
align: 'align',
[965] Fix | Delete
size: 'image-size',
[966] Fix | Delete
alt: 'image_alt'
[967] Fix | Delete
}, function( option, prop ) {
[968] Fix | Delete
if ( props[ prop ] ) {
[969] Fix | Delete
options[ option ] = props[ prop ];
[970] Fix | Delete
}
[971] Fix | Delete
});
[972] Fix | Delete
} else if ( 'video' === attachment.type ) {
[973] Fix | Delete
html = wp.media.string.video( props, attachment );
[974] Fix | Delete
} else if ( 'audio' === attachment.type ) {
[975] Fix | Delete
html = wp.media.string.audio( props, attachment );
[976] Fix | Delete
} else {
[977] Fix | Delete
html = wp.media.string.link( props );
[978] Fix | Delete
options.post_title = props.title;
[979] Fix | Delete
}
[980] Fix | Delete
[981] Fix | Delete
return wp.media.post( 'send-attachment-to-editor', {
[982] Fix | Delete
nonce: wp.media.view.settings.nonce.sendToEditor,
[983] Fix | Delete
attachment: options,
[984] Fix | Delete
html: html,
[985] Fix | Delete
post_id: wp.media.view.settings.post.id
[986] Fix | Delete
});
[987] Fix | Delete
},
[988] Fix | Delete
/**
[989] Fix | Delete
* Called when 'Insert From URL' source is not an image. Example: YouTube url.
[990] Fix | Delete
*
[991] Fix | Delete
* @param {Object} embed
[992] Fix | Delete
* @return {Promise}
[993] Fix | Delete
*/
[994] Fix | Delete
link: function( embed ) {
[995] Fix | Delete
return wp.media.post( 'send-link-to-editor', {
[996] Fix | Delete
nonce: wp.media.view.settings.nonce.sendToEditor,
[997] Fix | Delete
src: embed.linkUrl,
[998] Fix | Delete
link_text: embed.linkText,
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function