Make WordPress Core

Changeset 22072


Ignore:
Timestamp:
09/27/2012 08:04:34 PM (12 years ago)
Author:
koopersmith
Message:

Add QuickPress support for new media workflow.

  • Adds the code required to include the new media scripts, styles, and settings to media_button().
  • Improves script dependencies, namely making media-upload require media-views.
  • Some CSS tweaks for the making the new button work well with QuickPress.

see #21390, fixes #22021.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin.css

    r22031 r22072  
    62176217
    62186218#dashboard_quick_press .wp-media-buttons {
    6219     margin: 0 0 .2em 8px;
     6219    margin: 0 0 .2em 1px;
    62206220    padding: 0;
    62216221}
  • trunk/wp-admin/edit-form-advanced.php

    r22007 r22072  
    1818if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) {
    1919    add_thickbox();
    20     wp_enqueue_script('media-upload');
    21     wp_enqueue_script( 'media-views' );
     20
     21    wp_enqueue_script( 'media-upload' );
    2222    wp_enqueue_style( 'media-views' );
    2323    wp_plupload_default_settings();
    2424    add_action( 'admin_footer', 'wp_print_media_templates' );
    25 
    26     wp_enqueue_script( 'mce-view' );
    2725}
    2826
  • trunk/wp-admin/includes/media.php

    r22039 r22072  
    378378 */
    379379function media_buttons($editor_id = 'content') {
     380    wp_enqueue_script( 'media-upload' );
     381    wp_enqueue_style( 'media-views' );
     382    wp_plupload_default_settings();
     383    add_action( 'admin_footer', 'wp_print_media_templates' );
     384
    380385    $context = apply_filters('media_buttons_context', __('Upload/Insert %s'));
    381386
  • trunk/wp-admin/js/media-upload.js

    r22044 r22072  
    149149    };
    150150
    151     $( wp.mce.media.init )
     151    $( wp.mce.media.init );
    152152}(jQuery));
  • trunk/wp-includes/script-loader.php

    r22036 r22072  
    298298    ) );
    299299
    300     $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'mce-view' ), false, 1 );
     300    $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'mce-view', 'media-views' ), false, 1 );
    301301
    302302    $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), 'r6', 1 );
Note: See TracChangeset for help on using the changeset viewer.