Fix menu links. see #11817
git-svn-id: http://svn.automattic.com/wordpress/trunk@13370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
654c7a3888
commit
67aed4d0a2
|
@ -173,7 +173,7 @@ if ( $postCounter > 0 && $menu_selected_id > 0 && ! $updated ) {
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<form onsubmit="updatepostdata()" action="nav-menus.php" method="post" enctype="multipart/form-data">
|
<form onsubmit="updatepostdata()" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data">
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
<?php if ( ! empty( $custom_menus ) ) : ?>
|
<?php if ( ! empty( $custom_menus ) ) : ?>
|
||||||
<?php echo $messagesdiv; ?>
|
<?php echo $messagesdiv; ?>
|
||||||
|
@ -195,10 +195,7 @@ if ( $postCounter > 0 && $menu_selected_id > 0 && ! $updated ) {
|
||||||
<?php
|
<?php
|
||||||
//DISPLAY existing menu
|
//DISPLAY existing menu
|
||||||
if ( $menu_selected_id > 0 ) {
|
if ( $menu_selected_id > 0 ) {
|
||||||
// SET output type
|
wp_print_nav_menu( 'type=backend&name='.$menu_title.'&id='.$menu_selected_id );
|
||||||
$output_type = "backend";
|
|
||||||
// MAIN OUTPUT FUNCTION
|
|
||||||
wp_print_nav_menu( 'type='.$output_type.'&name='.$menu_title.'&id='.$menu_selected_id );
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -107,14 +107,14 @@ function wp_print_nav_menu_item($menu_item, $context, $args = array() ) {
|
||||||
<a class="hide" href="<?php echo $menu_item->link; ?>"><?php echo $menu_item->title; ?></a>
|
<a class="hide" href="<?php echo $menu_item->link; ?>"><?php echo $menu_item->title; ?></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<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; ?>" />
|
<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; ?>" />
|
||||||
<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; ?>" />
|
<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 ) ); ?>" />
|
||||||
<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; ?>" />
|
<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; ?>" />
|
||||||
<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; ?>" />
|
<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; ?>" />
|
||||||
<input type="hidden" name="linkurl<?php echo $menu_item->menu_order; ?>" id="linkurl<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->link; ?>" />
|
<input type="hidden" name="linkurl<?php echo $menu_item->menu_order; ?>" id="linkurl<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->link; ?>" />
|
||||||
<input type="hidden" name="description<?php echo $menu_item->menu_order; ?>" id="description<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->description; ?>" />
|
<input type="hidden" name="description<?php echo $menu_item->menu_order; ?>" id="description<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->description; ?>" />
|
||||||
<input type="hidden" name="icon<?php echo $menu_item->menu_order; ?>" id="icon<?php echo $menu_item->menu_order; ?>" value="0" />
|
<input type="hidden" name="icon<?php echo $menu_item->menu_order; ?>" id="icon<?php echo $menu_item->menu_order; ?>" value="0" />
|
||||||
<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; ?>" />
|
<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; ?>" />
|
||||||
<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; ?>" />
|
<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 ) ); ?>" />
|
||||||
<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 ); ?>" />
|
<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 ); ?>" />
|
||||||
<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' ); ?>" />
|
<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' ); ?>" />
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -94,10 +94,7 @@ function wp_setup_nav_menu_item($menu_item, $type = 'item', $position = 0) {
|
||||||
switch ( $menu_item->type ) {
|
switch ( $menu_item->type ) {
|
||||||
// Page Menu Item
|
// Page Menu Item
|
||||||
case 'page':
|
case 'page':
|
||||||
if ( $menu_item->guid == '' )
|
$menu_item->link = get_page_link( $menu_item->object_id );
|
||||||
$menu_item->link = get_permalink( $menu_item->object_id );
|
|
||||||
else
|
|
||||||
$menu_item->link = $menu_item->guid;
|
|
||||||
|
|
||||||
if ( $menu_item->post_title == '' )
|
if ( $menu_item->post_title == '' )
|
||||||
$menu_item->title = htmlentities( get_the_title( $menu_item->object_id ) );
|
$menu_item->title = htmlentities( get_the_title( $menu_item->object_id ) );
|
||||||
|
@ -113,10 +110,7 @@ function wp_setup_nav_menu_item($menu_item, $type = 'item', $position = 0) {
|
||||||
break;
|
break;
|
||||||
// Category Menu Item
|
// Category Menu Item
|
||||||
case 'category':
|
case 'category':
|
||||||
if ( empty($menu_item->guid) )
|
|
||||||
$menu_item->link = get_category_link( $menu_item->object_id );
|
$menu_item->link = get_category_link( $menu_item->object_id );
|
||||||
else
|
|
||||||
$menu_item->link = $menu_item->guid;
|
|
||||||
|
|
||||||
if ( empty($menu_item->post_title) ) {
|
if ( empty($menu_item->post_title) ) {
|
||||||
$title_raw = get_category( $menu_item->object_id );
|
$title_raw = get_category( $menu_item->object_id );
|
||||||
|
|
Loading…
Reference in New Issue