Changeset 10124 for trunk/wp-admin/includes/media.php
- Timestamp:
- 12/08/2008 07:38:05 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r10118 r10124 35 35 function update_gallery_tab($tabs) { 36 36 global $wpdb; 37 37 38 if ( !isset($_REQUEST['post_id']) ) { 38 39 unset($tabs['gallery']); 39 40 return $tabs; 40 41 } 42 41 43 if ( intval($_REQUEST['post_id']) ) 42 44 $attachments = intval($wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $_REQUEST['post_id']))); 45 46 if ( empty($attachments) ) { 47 unset($tabs['gallery']); 48 return $tabs; 49 } 43 50 44 51 $tabs['gallery'] = sprintf(__('Gallery (%s)'), "<span id='attachments-count'>$attachments</span>");
Note: See TracChangeset
for help on using the changeset viewer.