Changeset 13733 for trunk/wp-admin/includes/nav-menu.php
- Timestamp:
- 03/17/2010 04:27:25 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/nav-menu.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/nav-menu.php
r13727 r13733 14 14 function wp_nav_menu_post_type_metaboxes() { 15 15 $post_types = get_post_types( array( 'public' => true ), 'object' ); 16 16 17 17 if ( !$post_types ) 18 18 return false; … … 100 100 function wp_nav_menu_item_link_metabox() { 101 101 $args = array( 'post_status' => 'any', 'post_type' => 'nav_menu_item', 'meta_value' => 'custom', 'showposts' => -1 ); 102 102 103 103 // @todo transient caching of these results with proper invalidation on updating links 104 104 $query = new WP_Query( $args ); 105 105 106 106 ?> 107 107 <p id="menu-item-url-wrap"> … … 118 118 </label> 119 119 </p> 120 120 121 121 <p class="button-controls"> 122 122 <a class="show-all"><?php _e('View All'); ?></a> … … 147 147 function wp_nav_menu_item_post_type_metabox( $object, $post_type ) { 148 148 $args = array( 'post_type' => $post_type['args']->name, 'post_status' => 'publish', 'showposts' => -1 ); 149 149 150 150 if ( 'attachment' == $post_type['args']->name ) 151 151 $args['post_status'] = 'any'; 152 152 153 153 // @todo transient caching of these results with proper invalidation on updating of a post of this type 154 154 $query = new WP_Query( $args ); 155 155 156 156 if ( !$query->posts ) 157 157 $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>'; 158 158 159 159 $pt_names = ''; 160 160 if ( is_array($query->posts) ) { … … 167 167 } 168 168 } 169 169 170 170 $id = $post_type['args']->name; 171 171 ?> … … 174 174 <a class="quick-search-submit button-secondary"><?php _e('Search'); ?></a> 175 175 </p> 176 176 177 177 <p class="button-controls"> 178 178 <a class="show-all"><?php _e('View All'); ?></a> 179 179 <a class="hide-all"><?php _e('Hide All'); ?></a> 180 180 </p> 181 181 182 182 <div id="existing-<?php echo esc_attr( $id ); ?>" class="list-wrap"> 183 183 <div class="list-container"> … … 219 219 // @todo transient caching of these results with proper invalidation on updating of a tax of this type 220 220 $terms = get_terms( $taxonomy['args']->name, $args ); 221 221 222 222 if ( !$terms ) 223 223 $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $taxonomy['args']->label ) .'</li>'; 224 224 225 225 $term_names = ''; 226 226 if ( is_array($terms) ) { … … 233 233 } 234 234 } 235 235 236 236 $id = $taxonomy['args']->name; 237 237 ?> … … 240 240 <a class="quick-search-submit button-secondary"><?php _e('Search'); ?></a> 241 241 </p> 242 242 243 243 <p class="button-controls"> 244 244 <a class="show-all"><?php _e('View All'); ?></a> 245 245 <a class="hide-all"><?php _e('Hide All'); ?></a> 246 246 </p> 247 247 248 248 <div id="existing-<?php echo esc_attr( $id ); ?>" class="list-wrap"> 249 249 <div class="list-container"> … … 282 282 if ( !$menu_items ) 283 283 return __( 'Not Found' ); 284 284 285 285 $output = ''; 286 286 $i = 1; … … 290 290 if ( !isset($menu_item->post_parent) ) 291 291 $menu_item->post_parent = $menu_item->parent; 292 292 293 293 // Cleanest way to get all attachements 294 294 if ( 'attachment' == $object ) 295 295 $menu_item->post_parent = 0; 296 296 297 297 if ( 0 == $menu_item->post_parent ) { 298 298 // Set up the menu item 299 $menu_item = wp_setup_nav_menu_item( $menu_item, $object_type, $object ); 299 $menu_item = wp_setup_nav_menu_item( $menu_item, $object_type, $object ); 300 300 $attributes = ( 'backend' == $context ) ? ' id="menu-item-'. $i .'" value="'. $i .'"' : ''; 301 301 302 302 $output .= '<li'. $attributes .'>'; 303 303 $output .= wp_get_nav_menu_item( $menu_item, $object_type, $object ); … … 308 308 } 309 309 } 310 310 311 311 return $output; 312 312 } … … 324 324 function wp_get_nav_menu_sub_items( $childof, $object_type, $object = null, $context = 'frontend' ) { 325 325 $args = array( 'child_of' => $childof, 'parent' => $childof, 'hide_empty' => false, ); 326 326 327 327 switch ( $object_type ) { 328 328 case 'post_type': … … 335 335 } 336 336 break; 337 337 338 338 case 'taxonomy': 339 339 if ( is_taxonomy_hierarchical( $object ) ) { … … 343 343 } 344 344 break; 345 345 346 346 default: 347 347 $sub_menu_items = array(); 348 348 break; 349 349 } 350 350 351 351 $output = ''; 352 352 $i = 1;
Note: See TracChangeset
for help on using the changeset viewer.