Make WordPress Core


Ignore:
Timestamp:
05/22/2011 11:25:28 PM (14 years ago)
Author:
ryan
Message:

Mark import attachments as private. Schedule job to delete old import attachments. Introduce attachment context.

File:
1 edited

Legend:

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

    r17996 r17999  
    997997    $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
    998998    $q['post_type'] = 'attachment';
    999     $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : 'inherit';
     999    $post_type = get_post_type_object( 'attachment' );
     1000    $states = array( 'inherit' );
     1001    if ( current_user_can( $post_type->cap->read_private_posts ) )
     1002        $states[] = 'private';
     1003
     1004    $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states;
    10001005    $media_per_page = (int) get_user_option( 'upload_per_page' );
    10011006    if ( empty( $media_per_page ) || $media_per_page < 1 )
Note: See TracChangeset for help on using the changeset viewer.