WordPress.org

Make WordPress Core

Changeset 13370


Ignore:
Timestamp:
02/24/2010 10:11:49 AM (12 years ago)
Author:
markjaquith
Message:

Fix menu links. see #11817

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/nav-menus.php

    r13369 r13370  
    174174        <div class="clear"></div>
    175175<?php } ?>
    176         <form onsubmit="updatepostdata()" action="nav-menus.php" method="post" enctype="multipart/form-data">
     176        <form onsubmit="updatepostdata()" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data">
    177177        <div class="inside">
    178178        <?php if ( ! empty( $custom_menus ) ) : ?>
     
    196196        //DISPLAY existing menu
    197197        if ( $menu_selected_id > 0 ) {
    198             // SET output type
    199             $output_type = "backend";
    200             // MAIN OUTPUT FUNCTION
    201             wp_print_nav_menu( 'type='.$output_type.'&name='.$menu_title.'&id='.$menu_selected_id );
     198            wp_print_nav_menu( 'type=backend&name='.$menu_title.'&id='.$menu_selected_id );
    202199        }
    203200        ?>
  • trunk/wp-includes/nav-menu-template.php

    r13368 r13370  
    108108                        <?php } ?>
    109109                        <input type="hidden" name="dbid<?php echo $menu_item->menu_order; ?>" id="dbid<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->ID; ?>" />
    110                         <input type="hidden" name="postmenu<?php echo $menu_item->menu_order; ?>" id="postmenu<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->ID; ?>" />
     110                        <input type="hidden" name="postmenu<?php echo $menu_item->menu_order; ?>" id="postmenu<?php echo $menu_item->menu_order; ?>" value="<?php echo esc_attr( get_post_meta( $menu_item->ID, 'object_id', true ) ); ?>" />
    111111                        <input type="hidden" name="parent<?php echo $menu_item->menu_order; ?>" id="parent<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->parent_item; ?>" />
    112112                        <input type="hidden" name="title<?php echo $menu_item->menu_order; ?>" id="title<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->title; ?>" />
     
    115115                        <input type="hidden" name="icon<?php echo $menu_item->menu_order; ?>" id="icon<?php echo $menu_item->menu_order; ?>" value="0" />
    116116                        <input type="hidden" name="position<?php echo $menu_item->menu_order; ?>" id="position<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->menu_order; ?>" />
    117                         <input type="hidden" name="linktype<?php echo $menu_item->menu_order; ?>" id="linktype<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->type; ?>" />
     117                        <input type="hidden" name="linktype<?php echo $menu_item->menu_order; ?>" id="linktype<?php echo $menu_item->menu_order; ?>" value="<?php echo esc_attr( get_post_meta( $menu_item->ID, 'menu_type', true ) ); ?>" />
    118118                        <input type="hidden" name="anchortitle<?php echo $menu_item->menu_order; ?>" id="anchortitle<?php echo $menu_item->menu_order; ?>" value="<?php echo esc_html( $menu_item->post_excerpt ); ?>" />
    119119                        <input type="hidden" name="newwindow<?php echo $menu_item->menu_order; ?>" id="newwindow<?php echo $menu_item->menu_order; ?>" value="<?php echo ( '' == $menu_item->post_content_filtered ? '0' : '1' ); ?>" />
  • trunk/wp-includes/nav-menu.php

    r13366 r13370  
    9595        // Page Menu Item
    9696        case 'page':
    97             if ( $menu_item->guid == '' )
    98                 $menu_item->link = get_permalink( $menu_item->object_id );
    99             else
    100                 $menu_item->link = $menu_item->guid;
     97            $menu_item->link = get_page_link( $menu_item->object_id );
    10198
    10299            if ( $menu_item->post_title == '' )
     
    114111        // Category Menu Item
    115112        case 'category':
    116             if ( empty($menu_item->guid) )
    117                 $menu_item->link = get_category_link( $menu_item->object_id );
    118             else
    119                 $menu_item->link = $menu_item->guid;
     113            $menu_item->link = get_category_link( $menu_item->object_id );
    120114
    121115            if ( empty($menu_item->post_title) ) {
Note: See TracChangeset for help on using the changeset viewer.