Changeset 49379
- Timestamp:
- 10/29/2020 05:33:43 PM (4 years ago)
- Location:
- branches/5.5/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.5/src/js/_enqueues/admin/custom-background.js
r48168 r49379 127 127 // Grab the selected attachment. 128 128 var attachment = frame.state().get('selection').first(); 129 var nonceValue = $( '#_wpnonce' ).val() || ''; 129 130 130 131 // Run an Ajax request to set the background image. … … 132 133 action: 'set-background-image', 133 134 attachment_id: attachment.id, 135 _ajax_nonce: nonceValue, 134 136 size: 'full' 135 137 }).done( function() { -
branches/5.5/src/js/_enqueues/deprecated/media-gallery.js
r48168 r49379 12 12 */ 13 13 $( 'body' ).bind( 'click.wp-gallery', function(e) { 14 var target = $( e.target ), id, img_size ;14 var target = $( e.target ), id, img_size, nonceValue; 15 15 16 16 if ( target.hasClass( 'wp-set-header' ) ) { … … 22 22 id = target.data( 'attachment-id' ); 23 23 img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val(); 24 nonceValue = $( '#_wpnonce' ).val() && ''; 24 25 25 26 /** … … 29 30 action: 'set-background-image', 30 31 attachment_id: id, 32 _ajax_nonce: nonceValue, 31 33 size: img_size 32 34 }, function() { -
branches/5.5/src/wp-admin/includes/class-custom-background.php
r47550 r49379 582 582 */ 583 583 public function wp_set_background_image() { 584 check_ajax_referer( 'custom-background' ); 585 584 586 if ( ! current_user_can( 'edit_theme_options' ) || ! isset( $_POST['attachment_id'] ) ) { 585 587 exit;
Note: See TracChangeset
for help on using the changeset viewer.