Make WordPress Core


Ignore:
Timestamp:
06/05/2014 10:00:24 PM (11 years ago)
Author:
helen
Message:

Grid view for the media library, first pass. This is alpha; expect imperfection. We will be iterating further.

props ericlewis, shaunandrews, wonderboymusic.
see #24716.

File:
1 edited

Legend:

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

    r28653 r28682  
    25932593    );
    25942594
     2595    $author = new WP_User( $attachment->post_author );
     2596    $response['authorName'] = $author->display_name;
     2597
     2598    if ( $attachment->post_parent ) {
     2599        $post_parent = get_post( $attachment->post_parent );
     2600        $response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' );
     2601        $response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(No title)' );
     2602    }
     2603
     2604    $bytes = filesize( get_attached_file( $attachment->ID ) );
     2605    $response['filesizeInBytes'] = $bytes;
     2606    $response['filesizeHumanReadable'] = size_format( $bytes );
     2607
    25952608    if ( current_user_can( 'edit_post', $attachment->ID ) ) {
    25962609        $response['nonces']['update'] = wp_create_nonce( 'update-post_' . $attachment->ID );
     
    28502863        'returnToLibrary'    => __( '← Return to library' ),
    28512864        'allMediaItems'      => __( 'All media items' ),
     2865        'allMediaTypes'      => __( 'All media types' ),
    28522866        'noItemsFound'       => __( 'No items found.' ),
    28532867        'insertIntoPost'     => $hier ? __( 'Insert into page' ) : __( 'Insert into post' ),
Note: See TracChangeset for help on using the changeset viewer.