Edit File by line
/home/barbar84/public_h.../wp-admin/js
File: media-gallery.js
/**
[0] Fix | Delete
* This file is used on media-upload.php which has been replaced by media-new.php and upload.php
[1] Fix | Delete
*
[2] Fix | Delete
* @deprecated 3.5.0
[3] Fix | Delete
* @output wp-admin/js/media-gallery.js
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
/* global ajaxurl */
[7] Fix | Delete
jQuery(function($) {
[8] Fix | Delete
/**
[9] Fix | Delete
* Adds a click event handler to the element with a 'wp-gallery' class.
[10] Fix | Delete
*/
[11] Fix | Delete
$( 'body' ).on( 'click.wp-gallery', function(e) {
[12] Fix | Delete
var target = $( e.target ), id, img_size, nonceValue;
[13] Fix | Delete
[14] Fix | Delete
if ( target.hasClass( 'wp-set-header' ) ) {
[15] Fix | Delete
// Opens the image to preview it full size.
[16] Fix | Delete
( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
[17] Fix | Delete
e.preventDefault();
[18] Fix | Delete
} else if ( target.hasClass( 'wp-set-background' ) ) {
[19] Fix | Delete
// Sets the image as background of the theme.
[20] Fix | Delete
id = target.data( 'attachment-id' );
[21] Fix | Delete
img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
[22] Fix | Delete
nonceValue = $( '#_wpnonce' ).val() && '';
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* This Ajax action has been deprecated since 3.5.0, see custom-background.php
[26] Fix | Delete
*/
[27] Fix | Delete
jQuery.post(ajaxurl, {
[28] Fix | Delete
action: 'set-background-image',
[29] Fix | Delete
attachment_id: id,
[30] Fix | Delete
_ajax_nonce: nonceValue,
[31] Fix | Delete
size: img_size
[32] Fix | Delete
}, function() {
[33] Fix | Delete
var win = window.dialogArguments || opener || parent || top;
[34] Fix | Delete
win.tb_remove();
[35] Fix | Delete
win.location.reload();
[36] Fix | Delete
});
[37] Fix | Delete
[38] Fix | Delete
e.preventDefault();
[39] Fix | Delete
}
[40] Fix | Delete
});
[41] Fix | Delete
});
[42] Fix | Delete
[43] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function