WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/10/2012 07:51:37 AM (9 years ago)
Author:
koopersmith
Message:

Media: Backwards compatibility for media_upload_tabs.

  • Adds createIframeStates() to the MediaFrame view. It creates states and bindings for the media_upload_tabs output, and is included on MediaFrame.Post by default.
  • Hijacks tb_remove() when the media modal is open to ensure the modal closes correctly.
  • Adds a chromeless parameter to thickbox media tab URLs to render the UI without the old row of tabs.

see #22186, #21390.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r22516 r22523  
    12981298 */
    12991299function wp_enqueue_media() {
     1300    // We're going to pass the old thickbox media tabs to `media_upload_tabs`
     1301    // to ensure plugins will work. We will then unset those tabs.
     1302    $tabs = array(
     1303        // handler action suffix => tab text
     1304        'type'     => __('From Computer'),
     1305        'type_url' => __('From URL'),
     1306        'gallery'  => __('Gallery'),
     1307        'library'  => __('Media Library'),
     1308    );
     1309
     1310    $tabs = apply_filters( 'media_upload_tabs', $tabs );
     1311    unset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] );
     1312
     1313    $settings = array(
     1314        'tabs'   => $tabs,
     1315        'tabUrl' => add_query_arg( array(
     1316            'chromeless' => true
     1317        ), admin_url('media-upload.php') ),
     1318    );
     1319
    13001320    wp_localize_script( 'media-views', '_wpMediaViewsL10n', array(
     1321        // Settings
     1322        'settings' => $settings,
     1323
    13011324        // Generic
    13021325        'insertMedia' => __( 'Insert Media' ),
Note: See TracChangeset for help on using the changeset viewer.