Changeset 13397
- Timestamp:
- 02/25/2010 08:48:17 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/nav-menus.php
r13395 r13397 118 118 $post = array( 'post_status' => 'publish', 'post_type' => 'nav_menu_item', 'post_author' => $user_ID, 119 119 'ping_status' => 0, 'post_parent' => 0, 'menu_order' => $position, 120 ' guid' => $custom_linkurl, 'post_excerpt' => $custom_anchor_title, 'tax_input' => array( 'nav_menu' => $menu_title ),120 'post_excerpt' => $custom_anchor_title, 'tax_input' => array( 'nav_menu' => $menu_title ), 121 121 'post_content' => $custom_description, 'post_title' => $custom_title ); 122 122 if ( $new_window ) 123 $post['post_content_filtered'] = '_blank';123 update_post_meta( $db_id, 'menu_new_window', 1 ); 124 124 else 125 $post['post_content_filtered'] = '';125 update_post_meta( $db_id, 'menu_new_window', 0 ); 126 126 if ( $parent_id > 0 && isset( $parent_menu_ids[$parent_id] ) ) 127 127 $post['post_parent'] = $parent_menu_ids[$parent_id]; 128 129 if ( $custom_linkurl ) 130 update_post_meta( $db_id, 'menu_link', esc_url_raw( $custom_linkurl ) ); 128 131 129 132 // New menu item -
trunk/wp-includes/nav-menu-template.php
r13395 r13397 117 117 <input type="hidden" name="linktype<?php echo esc_attr( $menu_item->menu_order ); ?>" id="linktype<?php echo esc_attr( $menu_item->menu_order ); ?>" value="<?php echo esc_attr( get_post_meta( $menu_item->ID, 'menu_type', true ) ); ?>" /> 118 118 <input type="hidden" name="anchortitle<?php echo esc_attr( $menu_item->menu_order ); ?>" id="anchortitle<?php echo esc_attr( $menu_item->menu_order ); ?>" value="<?php echo esc_attr( $menu_item->post_excerpt ); ?>" /> 119 <input type="hidden" name="newwindow<?php echo esc_attr( $menu_item->menu_order ); ?>" id="newwindow<?php echo esc_attr( $menu_item->menu_order ); ?>" value="<?php echo ( '' == $menu_item->post_content_filtered ? '0' : '1' ); ?>" />119 <input type="hidden" name="newwindow<?php echo esc_attr( $menu_item->menu_order ); ?>" id="newwindow<?php echo esc_attr( $menu_item->menu_order ); ?>" value="<?php echo ( get_post_meta( $menu_item->ID, 'menu_new_window', true ) ? '1' : '0' ); ?>" /> 120 120 <?php 121 121 break; -
trunk/wp-includes/nav-menu.php
r13375 r13397 75 75 $menu_item->type = get_post_meta($menu_item->ID, 'menu_type', true); 76 76 $menu_item->object_id = get_post_meta($menu_item->ID, 'object_id', true); 77 $menu_item->target = ( get_post_meta( $menu_item->ID, 'menu_new_window', true ) ) ? 'target="_blank"' : ''; 77 78 if ( isset( $parent_menu_order[ $menu_item->post_parent ] ) ) 78 79 $menu_item->parent_item = $parent_menu_order[ $menu_item->post_parent ]; … … 93 94 94 95 switch ( $menu_item->type ) { 95 // Page Menu Item 96 case 'page': 96 case 'page' : 97 97 $menu_item->link = get_page_link( $menu_item->object_id ); 98 98 … … 106 106 else 107 107 $menu_item->description = $menu_item->post_content; 108 $menu_item->target = '';109 108 $menu_item->append = _x('Page', 'menu nav item type'); 110 break; 111 // Category Menu Item 112 case 'category': 109 break; 110 case 'category' : 113 111 $menu_item->link = get_category_link( $menu_item->object_id ); 114 112 … … 124 122 else 125 123 $menu_item->description = $menu_item->post_content; 126 $menu_item->target = '';127 124 $menu_item->append = _x('Category', 'menu nav item type'); 128 break;129 default:130 // Custom Menu Item131 $menu_item->link = $menu_item->guid;125 break; 126 case 'custom' : 127 default : 128 $menu_item->link = esc_url_raw( get_post_meta( $menu_item->ID, 'menu_link', true ) ); 132 129 $menu_item->title = $menu_item->post_title; 133 130 $menu_item->description = $menu_item->post_content; 134 $menu_item->target = 'target="_blank"';135 131 $menu_item->append = _x('Custom', 'menu nav item type'); 136 break;132 break; 137 133 } 138 134
Note: See TracChangeset
for help on using the changeset viewer.