Ticket #10620: 10620.patch
File 10620.patch, 1.3 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/media.php
41 41 } 42 42 43 43 if ( intval($_REQUEST['post_id']) ) 44 $attachments = intval($wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_ parent = %d", $_REQUEST['post_id'])));44 $attachments = intval($wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $_REQUEST['post_id']))); 45 45 46 46 if ( empty($attachments) ) { 47 47 unset($tabs['gallery']); … … 1054 1054 if ( $post && $post->post_type == 'attachment' ) 1055 1055 $attachments = array($post->ID => $post); 1056 1056 else 1057 $attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', ' orderby' => 'menu_order ASC, ID', 'order' => 'DESC') );1057 $attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'post_status' => 'inherit', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') ); 1058 1058 } else { 1059 1059 if ( is_array($GLOBALS['wp_the_query']->posts) ) 1060 1060 foreach ( $GLOBALS['wp_the_query']->posts as $attachment )