Make WordPress Core


Ignore:
Timestamp:
08/26/2014 03:57:20 PM (11 years ago)
Author:
helen
Message:

Media library: Unify headers between view modes.

Includes back compat for views_upload links. These look a little awkward, but do not appear to be commonly used. Also prevents the view mode links from being dropped on smaller screens so a user doesn't get "stuck" in the list view.

This is different from other list tables, but aligns well with other uploaded content management screens (themes, plugins).

props pento, helen.
fixes #28946.

File:
1 edited

Legend:

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

    r29206 r29625  
    10331033
    10341034    $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states;
     1035    $q['post_status'] = isset( $q['attachment-filter'] ) && 'trash' == $q['attachment-filter'] ? 'trash' : $states;
     1036
    10351037    $media_per_page = (int) get_user_option( 'upload_per_page' );
    10361038    if ( empty( $media_per_page ) || $media_per_page < 1 )
     
    10521054        unset($q['post_mime_type']);
    10531055
    1054     if ( isset($q['detached']) )
     1056    foreach( array_keys( $post_mime_types ) as $type ) {
     1057        if ( isset( $q['attachment-filter'] ) && "post_mime_type:$type" == $q['attachment-filter'] ) {
     1058            $q['post_mime_type'] = $type;
     1059            break;
     1060        }
     1061    }
     1062
     1063    if ( isset( $q['detached'] ) || ( isset( $q['attachment-filter'] ) && 'detached' == $q['attachment-filter'] ) ) {
    10551064        $q['post_parent'] = 0;
     1065    }
    10561066
    10571067    wp( $q );
Note: See TracChangeset for help on using the changeset viewer.