diff --git a/wp-admin/custom-navigation.php b/wp-admin/custom-navigation.php index 9cbdf60818..361d500663 100644 --- a/wp-admin/custom-navigation.php +++ b/wp-admin/custom-navigation.php @@ -45,22 +45,22 @@ function wp_custom_navigation() { ?>
-

You do not have JavaScript enabled in your browser. Please enabled it to access the Custom Menu functionality.

+

You do not have JavaScript enabled in your browser. Please enable it to access the Custom Menu functionality.

false ) ); if ( !empty( $custom_menus ) ) $menu_selected_id = $custom_menus[0]->term_id; @@ -84,7 +84,8 @@ function wp_custom_navigation() { $postCounter = $_POST['licount']; else $postCounter = 0; - + + // Create a new menu. Menus are stored as terms in the 'menu' taxonomy. if ( isset( $_POST['add_menu'] ) ) { $insert_menu_name = $_POST['add_menu_name']; @@ -106,21 +107,19 @@ function wp_custom_navigation() { } else { $messagesdiv = '

Please enter a valid Menu name

'; } - - } - if (isset($_POST['reset_wp_menu'])) { + if ( isset($_POST['reset_wp_menu']) ) { $success = wp_custom_nav_reset(); if ($success) { - //DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly - $messagesdiv = '

'.$themename.'s Custom Menu has been RESET!

'; - //GET reset menu id - $custom_menus = array(); - $menu_selected_id = 0; + // DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly + $messagesdiv = '

'.$themename.'s Custom Menu has been RESET!

'; + // GET reset menu id + $custom_menus = array(); + $menu_selected_id = 0; } else { - //DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly - $messagesdiv = '

'.$themename.'s Custom Menu could not be RESET. Please try again.

'; + // DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly + $messagesdiv = '

'.$themename.'s Custom Menu could not be RESET. Please try again.

'; } } elseif ( $postCounter > 0 && $menu_selected_id > 0 ) { $menu_objects = get_objects_in_term( $menu_selected_id, 'menu' ); @@ -285,7 +284,7 @@ function wp_custom_navigation() { //DISPLAY SELECT OPTIONS foreach( $custom_menus as $menu ) { $menu_term = get_term( $menu, 'menu' ); - if ( ( $menu_id_in_edit == $menu ) || ( $menu_selected_id == $menu ) ) + if ( ( $menu_id_in_edit == $menu->term_id ) || ( $menu_selected_id == $menu->term_id ) ) $selected_option = 'selected="selected"'; else $selected_option = ''; diff --git a/wp-admin/js/custom-navigation-default-items.dev.js b/wp-admin/js/custom-navigation-default-items.dev.js index 84db0ebe86..22cc44ea35 100644 --- a/wp-admin/js/custom-navigation-default-items.dev.js +++ b/wp-admin/js/custom-navigation-default-items.dev.js @@ -12,7 +12,7 @@ /* * Init Functions */ -$(function() +jQuery(function($) { //Makes dialog box $("#dialog-confirm").dialog({ diff --git a/wp-admin/js/custom-navigation-default-items.js b/wp-admin/js/custom-navigation-default-items.js index b1a8ac5139..997f285f9a 100644 --- a/wp-admin/js/custom-navigation-default-items.js +++ b/wp-admin/js/custom-navigation-default-items.js @@ -1 +1 @@ -$(function(){$("#dialog-confirm").dialog({autoOpen:false,resizable:false,height:210,width:400,modal:true,buttons:{Save:function(){titletosave=$("#edittitle").attr("value");linktosave=$("#editlink").attr("value");anchortitletosave=$("#editanchortitle").attr("value");newwindowtosave=$("#editnewwindow").attr("value");desctosave=$("#editdescription").attr("value");$("#title"+$(this).dialog("option","itemID")).attr("value",titletosave);$("#linkurl"+$(this).dialog("option","itemID")).attr("value",linktosave);$("#anchortitle"+$(this).dialog("option","itemID")).attr("value",anchortitletosave);$("#newwindow"+$(this).dialog("option","itemID")).attr("value",newwindowtosave);$("#description"+$(this).dialog("option","itemID")).attr("value",desctosave);$("#menu-"+$(this).dialog("option","itemID")+" > dl > dt > span.title").text(titletosave);$("#view"+ +$(this).dialog("option","itemID")).attr("href",linktosave);$(this).dialog("close")},Cancel:function(){$(this).dialog("close")}}});$("#message").animate({opacity:1},2000).fadeOut(300,function(){$(this).remove()});$("#custom-nav li").prepend('
');$("#custom-nav li").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});$("#custom-nav dl, #custom-nav .dropzone").droppable({accept:"#custom-nav li",tolerance:"pointer",drop:function(f,d){var a=$(this).parent();var g=!$(this).hasClass("dropzone");if(g&&a.children("ul").length==0){a.append('