Changeset 13512 for trunk/wp-admin/nav-menus.php
- Timestamp:
- 02/28/2010 08:00:49 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/nav-menus.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/nav-menus.php
r13473 r13512 43 43 $updated = false; 44 44 $advanced_option_descriptions = 'no'; 45 46 // Get all menu link items47 $available_links = new WP_Query( array( 'post_status' => 'any', 'post_type' => 'nav_menu_item', 'meta_key' => 'menu_type', 'meta_value' => 'custom' ) );48 45 49 46 // Check which menu is selected and if menu is in edit already … … 128 125 // Loop through all POST variables 129 126 for ( $k = 1; $k <= $post_counter; $k++ ) { 130 $db_id = isset( $_POST[' dbid'.$k] )? $_POST['dbid'.$k] : 0;131 $object_id = isset( $_POST[' postmenu'.$k] )? $_POST['postmenu'.$k] : 0;132 $parent_id = isset( $_POST[' parent'.$k] )? $_POST['parent'.$k] : 0;127 $db_id = isset( $_POST['item-dbid'.$k] )? $_POST['item-dbid'.$k] : 0; 128 $object_id = isset( $_POST['item-postmenu'.$k] )? $_POST['item-postmenu'.$k] : 0; 129 $parent_id = isset( $_POST['item-parent'.$k] )? $_POST['item-parent'.$k] : 0; 133 130 $custom_title = isset( $_POST['item-title'.$k] )? $_POST['item-title'.$k] : ''; 134 131 $custom_linkurl = ( isset( $_POST['item-url'.$k] ) && 'custom' == $_POST['linktype'.$k] ) ? $_POST['item-url'.$k] : ''; 135 132 $custom_description = isset( $_POST['item-description'.$k] )? $_POST['item-description'.$k] : ''; 133 136 134 // doesn't seem to be used by UI 137 $icon = isset( $_POST['icon'.$k] )? $_POST['icon'.$k] : 0; 138 $position = isset( $_POST['position'.$k] )? $_POST['position'.$k] : 0; 139 $linktype = isset( $_POST['linktype'.$k] )? $_POST['linktype'.$k] : 'custom'; 135 $position = isset( $_POST['item-position'.$k] )? $_POST['item-position'.$k] : 0; 136 $linktype = isset( $_POST['item-type'.$k] )? $_POST['item-type'.$k] : 'custom'; 140 137 $custom_anchor_title = isset( $_POST['item-attr-title'.$k] )? $_POST['item-attr-title'.$k] : $custom_title; 141 138 $new_window = isset( $_POST['item-target'.$k] )? $_POST['item-target'.$k] : 0; … … 210 207 <input type="hidden" name="li-count" id="li-count" value="0" /> 211 208 <input type="hidden" name="menu-id-in-edit" id="menu-id-in-edit" value="<?php echo esc_attr( $menu_selected_id ); ?>" /> 212 213 <ul id="menu">214 209 <?php 215 if ( $menu_selected_id > 0 ) { 216 wp_print_nav_menu( array( 'type' => 'backend', 'name' => $menu_title, 'id' => $menu_selected_id ) ); 217 } 210 if ( $menu_selected_id > 0 ) 211 echo wp_get_nav_menu( array( 'type' => 'backend', 'menu' => $menu_selected_id, 'ul_class' => 'menu' ) ); 218 212 ?> 219 </ul><!-- /#menu-->220 213 221 214 <div id="queue" class="hide"> … … 266 259 </p> 267 260 268 <?php if ( $available_links->posts ) : ?>269 261 <p class="button-controls"> 270 262 <a class="show-all button"><?php _e('View All'); ?></a> … … 274 266 <div class="list-container"> 275 267 <ul class="list"> 276 <?php 277 foreach ( $available_links->posts as $link ) : 278 $url = get_post_meta( $link->ID, 'menu_link' ); 279 ?> 280 <li> 281 <dl> 282 <dt> 283 <label class="item-title"><input type="checkbox" id="link-<?php echo esc_attr($link->ID); ?>" name="<?php echo esc_attr($link->post_title); ?>" value="<?php echo esc_attr($url[0]); ?>" /><?php echo esc_html($link->post_title); ?></label> 284 </dt> 285 </dl> 286 </li> 287 <?php 288 endforeach; 289 ?> 268 <?php $items_counter = wp_nav_menu_get_custom_links( 0, 'default' ); ?> 290 269 </ul> 291 270 </div><!-- /.list-container--> 292 271 </div><!-- /#available-links--> 293 <?php endif; ?>294 272 <p class="add-to-menu"> 295 273 <a class="button"><?php _e('Add to Menu'); ?></a> … … 326 304 jQuery('#add-pages .quick-search').result(function(event, data, formatted) { 327 305 jQuery('#add-pages .list-wrap').css('display','block'); 328 jQuery("#add-pages .list-wrap dt:contains('" + data + "')").css('display','block');306 jQuery("#add-pages .list-wrap li:contains('" + data + "')").css('display','block'); 329 307 jQuery('#add-pages .show-all').hide(); 330 308 jQuery('#add-pages .hide-all').show(); … … 345 323 <div class="list-container"> 346 324 <ul class="list"> 347 <?php $items_counter = wp_nav_menu_get_pages( 0, 'default' ); ?>325 <?php $items_counter = wp_nav_menu_get_pages( $items_counter, 'default' ); ?> 348 326 </ul> 349 327 </div><!-- /.list-container--> … … 388 366 jQuery('#add-categories .quick-search').result(function(event, data, formatted) { 389 367 jQuery('#add-categories .list-wrap').css('display','block'); 390 jQuery("#add-categories .list-wrap dt:contains('" + data + "')").css('display','block');368 jQuery("#add-categories .list-wrap li:contains('" + data + "')").css('display','block'); 391 369 jQuery('#add-categories .show-all').hide(); 392 370 jQuery('#add-categories .hide-all').show();
Note: See TracChangeset
for help on using the changeset viewer.