Changeset 13355
- Timestamp:
- 02/24/2010 01:44:16 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-navigation.php
r13352 r13355 41 41 42 42 // Check which menu is selected and if menu is in edit already 43 if ( isset( $_ POST['switch_menu'] ) ) {44 $menu_selected_id = (int) $_ POST['menu_select'];43 if ( isset( $_GET['edit_menu'] ) ) { 44 $menu_selected_id = (int) $_GET['edit_menu']; 45 45 $updated = true; 46 } elseif ( isset( $_POST[ 'menu_id_in_edit'] ) ) {47 $menu_selected_id = (int) $_POST[ 'menu_id_in_edit'];46 } elseif ( isset( $_POST[ 'menu_id_in_edit' ] ) ) { 47 $menu_selected_id = (int) $_POST[ 'menu_id_in_edit' ]; 48 48 } else { 49 49 $menu_selected_id = 0; … … 174 174 <div id="no-js"><h3><?php _e('You do not have JavaScript enabled in your browser. Please enable it to access the Menus functionality.'); ?></h3></div> 175 175 <div id="pages-left"> 176 <ul class="subsubsub"> 177 <?php if ( ! empty( $custom_menus ) ) { 178 foreach ( $custom_menus as $menu ) { 179 $menu_term = get_term( $menu, 'nav_menu' ); 180 if ( ( $menu_id_in_edit == $menu->term_id ) || ( $menu_selected_id == $menu->term_id ) ) { ?> 181 <li><?php echo esc_html( $menu_term->name ); ?> |</li> 182 <?php } else { ?> 183 <li><a href='custom-navigation.php?edit_menu=<?php echo esc_attr($menu_term->term_id); ?>'><?php echo esc_html( $menu_term->name ); ?></a> |</li> 184 <?php } 185 } 186 } else { ?> 187 <li><?php _e( 'Default' ); ?></li> 188 <?php } ?> 189 </ul> 190 <div class="clear"></div> 176 191 <div class="inside"> 177 192 <?php … … 250 265 <input id="reset_wp_menu" type="submit" value="Reset" name="reset_wp_menu" class="button" onclick="return confirm('<?php _e('Are you sure you want to reset the menu to its default settings?'); ?>');" /> 251 266 </span> 252 253 <div class="fix"></div> 254 </div> 255 </div><!-- /.widgets-holder-wrap --> 256 257 <div class="widgets-holder-wrap"> 258 <div class="sidebar-name"> 259 <div class="sidebar-name-arrow"></div> 260 <h3><?php esc_html_e('Menu Selector'); ?></h3> 261 </div> 262 <div class="widget-holder"> 263 <select id="menu_select" name="menu_select"> 264 <?php 265 // Display select options 266 foreach ( $custom_menus as $menu ) { 267 $menu_term = get_term( $menu, 'nav_menu' ); 268 if ( ( $menu_id_in_edit == $menu->term_id ) || ( $menu_selected_id == $menu->term_id ) ) 269 $selected_option = 'selected="selected"'; 270 else 271 $selected_option = ''; 272 ?> 273 <option value="<?php echo esc_attr($menu_term->term_id); ?>" <?php echo $selected_option; ?>><?php echo $menu_term->name; ?></option> 274 <?php 275 } 276 ?> 277 </select> 278 279 <input id="switch_menu" type="submit" value="<?php esc_attr_e('Switch'); ?>" name="switch_menu" class="button" /> 267 <br /><br /> 268 <span> 280 269 <input id="add_menu_name" name="add_menu_name" type="text" value="" /> 281 270 <input id="add_menu" type="submit" value="<?php esc_attr_e('Add Menu'); ?>" name="add_menu" class="button" /> 282 283 <div class="fix"></div> 271 </span> 284 272 </div> 285 273 </div><!-- /.widgets-holder-wrap -->
Note: See TracChangeset
for help on using the changeset viewer.