WordPress.org

Make WordPress Core

Changeset 22489


Ignore:
Timestamp:
11/09/2012 04:57:25 AM (8 years ago)
Author:
koopersmith
Message:

Media: Add wp_enqueue_media to easily include all media dependencies.

Also, media templates now print on wp_footer.

props sushkov. fixes #22060, see #21390.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r22446 r22489  
    1818if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) {
    1919    add_thickbox();
    20 
    21     wp_enqueue_script( 'media-upload' );
    22     wp_enqueue_style( 'media-views' );
    23     wp_plupload_default_settings();
    24     add_action( 'admin_footer', 'wp_print_media_templates' );
    2520}
    2621
  • trunk/wp-admin/includes/media.php

    r22486 r22489  
    384384 */
    385385function media_buttons($editor_id = 'content') {
    386     wp_enqueue_script( 'media-upload' );
    387     wp_enqueue_style( 'media-views' );
    388     wp_plupload_default_settings();
    389     add_action( 'admin_footer', 'wp_print_media_templates' );
     386    wp_enqueue_media();
    390387
    391388    $context = apply_filters('media_buttons_context', __('Upload/Insert %s'));
  • trunk/wp-includes/media.php

    r22488 r22489  
    12921292
    12931293/**
     1294 * Enqueues all scripts, styles, settings, and templates necessary to use
     1295 * all media JS APIs.
     1296 *
     1297 * @since 3.5.0
     1298 */
     1299function wp_enqueue_media() {
     1300    wp_enqueue_script( 'media-upload' );
     1301    wp_enqueue_style( 'media-views' );
     1302    wp_plupload_default_settings();
     1303    add_action( 'admin_footer', 'wp_print_media_templates' );
     1304    add_action( 'wp_footer', 'wp_print_media_templates' );
     1305}
     1306
     1307/**
    12941308 * Prints the templates used in the media manager.
    12951309 *
Note: See TracChangeset for help on using the changeset viewer.