Make WordPress Core

Changeset 22865


Ignore:
Timestamp:
11/27/2012 02:58:08 PM (12 years ago)
Author:
ryan
Message:

Back compat $_REQUESTpost_id? for media XHR requests.

Props koopersmith, nacin.
fixes #22588

Location:
trunk/wp-includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/media-editor.js

    r22847 r22865  
    460460            link: function( embed ) {
    461461                return media.post( 'send-link-to-editor', {
    462                     nonce: wp.media.view.settings.nonce.sendToEditor,
    463                     src:   embed.linkUrl,
    464                     title: embed.title,
    465                     html:  wp.media.string.link( embed )
     462                    nonce:   wp.media.view.settings.nonce.sendToEditor,
     463                    src:     embed.linkUrl,
     464                    title:   embed.title,
     465                    html:    wp.media.string.link( embed ),
     466                    post_id: wp.media.view.settings.postId
    466467                }).done( function( resp ) {
    467468                    wp.media.editor.insert( resp );
  • trunk/wp-includes/js/media-models.js

    r22842 r22865  
    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
     
    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 );
     
    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
  • trunk/wp-includes/js/media-views.js

    r22851 r22865  
    1212    media.view.settings = l10n.settings || {};
    1313    delete l10n.settings;
     14
     15    // Copy the `postId` setting over to the model settings.
     16    media.model.settings.postId = media.view.settings.postId;
    1417
    1518    // Check if the browser supports CSS 3.0 transitions
  • trunk/wp-includes/script-loader.php

    r22833 r22865  
    325325            'saveAttachmentNonce' => wp_create_nonce( 'save-attachment' ),
    326326            'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
     327            'postId'  => 0,
    327328        ),
    328329    ) );
Note: See TracChangeset for help on using the changeset viewer.