Changeset 6910 for trunk/wp-admin/includes/post.php
- Timestamp:
- 02/19/2008 06:13:20 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r6872 r6910 503 503 ); 504 504 505 $post_stati = apply_filters('post_stati', $post_stati); 506 505 507 $avail_post_stati = get_available_post_statuses('post'); 506 508 … … 523 525 524 526 return array($post_stati, $avail_post_stati); 527 } 528 529 function get_available_post_mime_types($type = 'attachment') { 530 global $wpdb; 531 532 $types = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s", $type)); 533 return $types; 534 } 535 536 function wp_edit_attachments_query( $q = false ) { 537 global $wpdb; 538 if ( false === $q ) 539 $q = $_GET; 540 $q['m'] = (int) $q['m']; 541 $q['cat'] = (int) $q['cat']; 542 $q['post_type'] = 'attachment'; 543 $q['post_status'] = 'any'; 544 $post_mime_types = array( // array( adj, noun ) 545 'image' => array(__('Images'), __('Manage Images'), __('Images (%s)')), 546 'audio' => array(__('Audio'), __('Manage Audio'), __('Audio (%s)')), 547 'video' => array(__('Video'), __('Manage Video'), __('Video (%s)')), 548 ); 549 $post_mime_types = apply_filters('post_mime_types', $post_mime_types); 550 551 $avail_post_mime_types = get_available_post_mime_types('attachment'); 552 553 if ( isset($q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) ) 554 unset($q['post_mime_type']); 555 556 wp($q); 557 558 return array($post_mime_types, $avail_post_mime_types); 525 559 } 526 560
Note: See TracChangeset
for help on using the changeset viewer.