Changeset 12702 for trunk/wp-admin/includes/template.php
- Timestamp:
- 01/12/2010 12:14:27 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r12694 r12702 749 749 */ 750 750 function wp_manage_posts_columns() { 751 global $typenow; 752 751 753 $posts_columns = array(); 752 754 $posts_columns['cb'] = '<input type="checkbox" />'; … … 754 756 $posts_columns['title'] = _x('Post', 'column name'); 755 757 $posts_columns['author'] = __('Author'); 756 $posts_columns['categories'] = __('Categories'); 757 $posts_columns['tags'] = __('Tags'); 758 if ( empty($typenow) || is_object_in_taxonomy($typenow, 'category') ) 759 $posts_columns['categories'] = __('Categories'); 760 if ( empty($typenow) || is_object_in_taxonomy($typenow, 'category') ) 761 $posts_columns['tags'] = __('Tags'); 758 762 $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all'; 759 if ( !in_array( $post_status, array('pending', 'draft', 'future') ) )763 if ( !in_array( $post_status, array('pending', 'draft', 'future') ) && ( empty($typenow) || post_type_supports($typenow, 'comments') ) ) 760 764 $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>'; 761 765 $posts_columns['date'] = __('Date'); … … 827 831 $_wp_column_headers = array(); 828 832 833 $map_screen = $page; 834 $type = str_replace('edit-', '', $map_screen); 835 if ( in_array($type, get_post_types()) ) 836 $map_screen = 'edit'; 837 829 838 // Store in static to avoid running filters on each call 830 839 if ( isset($_wp_column_headers[$page]) ) 831 840 return $_wp_column_headers[$page]; 832 841 833 switch ($ page) {842 switch ($map_screen) { 834 843 case 'edit': 835 844 $_wp_column_headers[$page] = wp_manage_posts_columns(); … … 925 934 $hidden = get_hidden_columns($type); 926 935 $styles = array(); 927 // $styles['tag']['posts'] = 'width: 90px;';928 // $styles['link-category']['links'] = 'width: 90px;';929 // $styles['category']['posts'] = 'width: 90px;';930 // $styles['link']['visible'] = 'text-align: center;';931 936 932 937 foreach ( $columns as $column_key => $column_display_name ) { … … 3495 3500 $screen = $typenow; 3496 3501 } 3502 if ( 'edit' == $screen ) { 3503 if ( !empty($typenow) ) 3504 $screen = 'edit-' . $typenow; 3505 } 3497 3506 3498 3507 if ( isset($meta_screens[$screen]) ) … … 3708 3717 3709 3718 function screen_options($screen) { 3710 switch ( $screen ) { 3719 $map_screen = $screen; 3720 $type = str_replace('edit-', '', $map_screen); 3721 if ( in_array($type, get_post_types()) ) 3722 $map_screen = 'edit'; 3723 3724 switch ( $map_screen ) { 3711 3725 case 'edit': 3712 3726 $per_page_label = __('Posts per page:');
Note: See TracChangeset
for help on using the changeset viewer.