Changeset 13535 for trunk/wp-admin/includes/template.php
- Timestamp:
- 03/01/2010 03:48:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r13510 r13535 912 912 $post_type_object = get_post_type_object( $screen->post_type ); 913 913 914 $taxonomy_names = get_object_taxonomies( $screen->post_type ); 915 $hierarchical_taxonomies = array(); 916 $flat_taxonomies = array(); 917 foreach ( $taxonomy_names as $taxonomy_name ) { 918 $taxonomy = get_taxonomy( $taxonomy_name); 919 920 if( !$taxonomy->show_ui ) continue; 921 922 if( $taxonomy->hierarchical ) 923 $hierarchical_taxonomies[] = $taxonomy; 924 else 925 $flat_taxonomies[] = $taxonomy; 926 } 927 914 928 $columns = wp_manage_posts_columns($screen); 915 929 $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) ); … … 1003 1017 </div></fieldset> 1004 1018 1005 <?php if ( is_object_in_taxonomy($screen->post_type, 'category') && !$bulk ) : ?>1019 <?php if ( count($hierarchical_taxonomies) && !$bulk ) : ?> 1006 1020 1007 1021 <fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col"> 1008 <span class="title inline-edit-categories-label"><?php _e( 'Categories' ); ?> 1022 1023 <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?> 1024 1025 <span class="title inline-edit-categories-label"><?php echo esc_html($taxonomy->label) ?> 1009 1026 <span class="catshow"><?php _e('[more]'); ?></span> 1010 1027 <span class="cathide" style="display:none;"><?php _e('[less]'); ?></span> 1011 1028 </span> 1012 <ul class="cat-checklist ">1013 <?php wp_ category_checklist();?>1029 <ul class="cat-checklist <?php echo esc_attr($taxonomy->name)?>-checklist"> 1030 <?php wp_terms_checklist(null, array('taxonomy' => $taxonomy->name)) ?> 1014 1031 </ul> 1032 1033 <?php endforeach; //$hierarchical_taxonomies as $taxonomy ?> 1034 1015 1035 </div></fieldset> 1016 1036 1017 <?php endif; // is_object_in_taxonomy($screen->post_type, 'category') && !$bulk ?>1037 <?php endif; // count($hierarchical_taxonomies) && !$bulk ?> 1018 1038 1019 1039 <fieldset class="inline-edit-col-right"><div class="inline-edit-col"> … … 1059 1079 <?php endif; // $post_type_object->hierarchical ?> 1060 1080 1061 <?php if ( is_object_in_taxonomy($screen->post_type, 'post_tag') && !$bulk ) : ?> 1081 <?php if ( count($flat_taxonomies) && !$bulk ) : ?> 1082 1083 <?php foreach ( $flat_taxonomies as $taxonomy ) : ?> 1062 1084 1063 1085 <label class="inline-edit-tags"> 1064 <span class="title"><?php _e( 'Tags' );?></span>1065 <textarea cols="22" rows="1" name="ta gs_input" class="tags_input"></textarea>1086 <span class="title"><?php echo esc_html($taxonomy->label) ?></span> 1087 <textarea cols="22" rows="1" name="tax_input[<?php echo esc_attr($taxonomy->name)?>]" class="tax_input_<?php echo esc_attr($taxonomy->name)?>"></textarea> 1066 1088 </label> 1067 1089 1068 <?php endif; // is_object_in_taxonomy($screen->post_type, 'post_tag') && !$bulk ?> 1090 <?php endforeach; //$flat_taxonomies as $taxonomy ?> 1091 1092 <?php endif; // count($flat_taxonomies) && !$bulk ?> 1069 1093 1070 1094 <?php if ( $bulk ) : ?> … … 1226 1250 echo '<div class="menu_order">' . $post->menu_order . '</div>'; 1227 1251 1228 if ( is_object_in_taxonomy($post->post_type, 'post_tag') ) 1229 echo '<div class="tags_input">' . esc_html( str_replace( ',', ', ', get_tags_to_edit($post->ID) ) ) . '</div>'; 1230 1231 if ( is_object_in_taxonomy($post->post_type, 'post_tag') ) 1232 echo '<div class="post_category">' . implode( ',', wp_get_post_categories( $post->ID ) ) . '</div>'; 1233 1234 if ( $post->post_type == 'post' ) 1252 $taxonomy_names = get_object_taxonomies( $post->post_type ); 1253 foreach ( $taxonomy_names as $taxonomy_name) { 1254 $taxonomy = get_taxonomy( $taxonomy_name ); 1255 1256 if ( $taxonomy->hierarchical && $taxonomy->show_ui ) 1257 echo '<div class="post_category" id="'.$taxonomy_name.'_'.$post->ID.'">' . implode( ',', wp_get_object_terms( $post->ID, $taxonomy_name, array('fields'=>'ids')) ) . '</div>'; 1258 elseif ( $taxonomy->show_ui ) 1259 echo '<div class="tags_input" id="'.$taxonomy_name.'_'.$post->ID.'">' . esc_html( str_replace( ',', ', ', get_terms_to_edit($post->ID, $taxonomy_name) ) ) . '</div>'; 1260 } 1261 1262 if ( !$post_type_object->hierarchical ) 1235 1263 echo '<div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>'; 1236 1264
Note: See TracChangeset
for help on using the changeset viewer.