WordPress.org

Make WordPress Core

Ticket #32765: 32765.patch

File 32765.patch, 1.5 KB (added by imath, 6 years ago)
  • src/wp-includes/js/media-views.js

    diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
    index 3b215a0..2853693 100644
    Cropper = wp.media.controller.State.extend({ 
    289289                content:     'crop',
    290290                router:      false,
    291291
    292                 canSkipCrop: false
     292                canSkipCrop: false,
     293                cropAction: 'custom-header-crop'
    293294        },
    294295
    295296        activate: function() {
    Cropper = wp.media.controller.State.extend({ 
    373374        },
    374375
    375376        doCrop: function( attachment ) {
    376                 return wp.ajax.post( 'custom-header-crop', {
     377                return wp.ajax.post( this.get( 'cropAction' ), {
    377378                        nonce: attachment.get('nonces').edit,
    378379                        id: attachment.get('id'),
    379380                        cropDetails: attachment.get('cropDetails')
  • src/wp-includes/js/media/controllers/cropper.js

    diff --git src/wp-includes/js/media/controllers/cropper.js src/wp-includes/js/media/controllers/cropper.js
    index 10f8020..c9bae5e 100644
    Cropper = wp.media.controller.State.extend({ 
    2121                content:     'crop',
    2222                router:      false,
    2323
    24                 canSkipCrop: false
     24                canSkipCrop: false,
     25                cropAction: 'custom-header-crop'
    2526        },
    2627
    2728        activate: function() {
    Cropper = wp.media.controller.State.extend({ 
    105106        },
    106107
    107108        doCrop: function( attachment ) {
    108                 return wp.ajax.post( 'custom-header-crop', {
     109                return wp.ajax.post( this.get( 'cropAction' ), {
    109110                        nonce: attachment.get('nonces').edit,
    110111                        id: attachment.get('id'),
    111112                        cropDetails: attachment.get('cropDetails')