WordPress.org

Make WordPress Core

Ticket #1915: dont-show-all-images-if-empty.diff

File dont-show-all-images-if-empty.diff, 909 bytes (added by davidhouse, 8 years ago)
  • wp-admin/inline-uploading.php

     
    414414<?php if ( $attachments = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post'") ) { ?> 
    415415<li<?php echo $current_2; ?>><a href="<?php echo basename(__FILE__); ?>?action=view&amp;post=<?php echo $post; ?>"><?php _e('Attached Images'); ?></a></li> 
    416416<?php } ?> 
     417<?php if ($wpdb->get_var("SELECT count(ID) FROM $wpdb->posts WHERE post_status = 'attachment' AND left(post_mime_type, 5) = 'image'")) { ?> 
    417418<li<?php echo $current_3; ?>><a href="<?php echo basename(__FILE__); ?>?action=view&amp;post=<?php echo $post; ?>&amp;all=true"><?php _e('All Images'); ?></a></li> 
     419<?php } ?> 
    418420<li> </li> 
    419421<?php if ( $action != 'upload' ) { ?> 
    420422<?php if ( false !== $back ) : ?>