Make WordPress Core

Ticket #22588: 22588.2.diff

File 22588.2.diff, 2.3 KB (added by koopersmith, 13 years ago)
  • wp-includes/js/media-models.js

     
    235235
    236236                                // Set the action and ID.
    237237                                options.data = _.extend( options.data || {}, {
    238                                         action: 'save-attachment',
    239                                         id:     this.id,
    240                                         nonce:  media.model.settings.saveAttachmentNonce
     238                                        action:  'save-attachment',
     239                                        id:      this.id,
     240                                        nonce:   media.model.settings.saveAttachmentNonce,
     241                                        post_id: media.model.settings.postId
    241242                                });
    242243
    243244                                // Record the values of the changed attributes.
     
    268269                        var model = this;
    269270
    270271                        return media.post( 'save-attachment-compat', _.defaults({
    271                                 id:     this.id,
    272                                 nonce:  media.model.settings.saveAttachmentNonce
     272                                id:      this.id,
     273                                nonce:   media.model.settings.saveAttachmentNonce,
     274                                post_id: media.model.settings.postId
    273275                        }, data ) ).done( function( resp, status, xhr ) {
    274276                                model.set( model.parse( resp, xhr ), options );
    275277                        });
     
    609611                                options = options || {};
    610612                                options.context = this;
    611613                                options.data = _.extend( options.data || {}, {
    612                                         action: 'query-attachments'
     614                                        action:  'query-attachments',
     615                                        post_id: media.model.settings.postId
    613616                                });
    614617
    615618                                // Clone the args so manipulation is non-destructive.
  • wp-includes/js/media-views.js

     
    1212        media.view.settings = l10n.settings || {};
    1313        delete l10n.settings;
    1414
     15        // Copy the `postId` setting over to the model settings.
     16        media.model.settings.postId = media.view.settings.postId;
     17
    1518        // Check if the browser supports CSS 3.0 transitions
    1619        $.support.transition = (function(){
    1720                var style = document.documentElement.style,
  • wp-includes/script-loader.php

     
    324324                'settings' => array(
    325325                        'saveAttachmentNonce' => wp_create_nonce( 'save-attachment' ),
    326326                        'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
     327                        'postId'  => 0,
    327328                ),
    328329        ) );
    329330