Make WordPress Core


Ignore:
Timestamp:
07/13/2014 04:15:36 PM (10 years ago)
Author:
ocean90
Message:

Media Grid improvements:

  • Remove fixed elements.
  • Adjusts toolbar and search, fixes #28833.
  • Add link to Add New button, fixes #28825.
  • Add "Edit Metadata" tab to all items, "Edit Image" only for images
  • Make strings translatable.
  • First pass for help tab.

see #28850.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/upload.php

    r29079 r29136  
    2525    wp_enqueue_script( 'media-grid' );
    2626    wp_enqueue_script( 'media' );
    27     wp_localize_script( 'media-grid', 'mediaGridSettings', array( 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH )  ) );
     27    wp_localize_script( 'media-grid', '_wpMediaGridSettings', array(
     28        'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ),
     29    ) );
    2830
    2931    add_screen_option( 'misc_screen_options', array( 'option' => 'manageuploadgridcolumnshidden', 'id' => 'grid' ) );
     
    3335    add_screen_option( 'mime', array( 'label' => __( 'Mime-type' ) ) );
    3436
     37    get_current_screen()->add_help_tab( array(
     38    'id'        => 'overview',
     39    'title'     => __( 'Overview' ),
     40    'content'   =>
     41        '<p>' . __( 'All the files you&#8217;ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the Screen Options tab to customize the display of this screen.' ) . '</p>'
     42    ) );
     43
     44    get_current_screen()->set_help_sidebar(
     45        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
     46        '<p>' . __( '<a href="http://codex.wordpress.org/Media_Library_Screen" target="_blank">Documentation on Media Library</a>' ) . '</p>' .
     47        '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
     48    );
     49
     50    $title = __('Media Library');
     51    $parent_file = 'upload.php';
     52
    3553    require_once( ABSPATH . 'wp-admin/admin-header.php' );
     54    ?>
     55    <div class="wrap">
     56        <h2>
     57        <?php
     58        echo esc_html( $title );
     59        if ( current_user_can( 'upload_files' ) ) { ?>
     60            <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'file' ); ?></a><?php
     61        }
     62        ?>
     63        </h2>
     64    </div>
     65    <?php
    3666    include( ABSPATH . 'wp-admin/admin-footer.php' );
    3767    exit;
Note: See TracChangeset for help on using the changeset viewer.