Make WordPress Core


Ignore:
Timestamp:
11/21/2012 04:46:32 PM (12 years ago)
Author:
koopersmith
Message:

Media: Move the new sections of media-upload.js to media-editor.js to allow the media modal to be used on the front end and prevent dependency conflicts with older themes and plugins. see #21390.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/script-loader.php

    r22653 r22770  
    299299    ) );
    300300
    301     $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'shortcode', 'media-views' ), false, 1 );
     301    $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'shortcode' ), false, 1 );
    302302
    303303    $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), 'r6', 1 );
     
    319319    ) );
    320320
     321    $scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );
    321322    $scripts->add( 'media-models', "/wp-includes/js/media-models$suffix.js", array( 'backbone', 'jquery' ), false, 1 );
    322323    did_action( 'init' ) && $scripts->localize( 'media-models', '_wpMediaModelsL10n', array(
    323         'saveAttachmentNonce' => wp_create_nonce( 'save-attachment' ),
    324     ) );
    325 
     324        'settings' => array(
     325            'saveAttachmentNonce' => wp_create_nonce( 'save-attachment' ),
     326            'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
     327        ),
     328    ) );
     329
     330    // To enqueue media-views or media-editor, call wp_enqueue_media().
     331    // Both rely on numerous settings, styles, and templates to operate correctly.
    326332    $scripts->add( 'media-views',  "/wp-includes/js/media-views$suffix.js",  array( 'media-models', 'wp-plupload' ), false, 1 );
    327     $scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );
     333    $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
    328334    $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 );
    329335
Note: See TracChangeset for help on using the changeset viewer.