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('')}if(g){a.children("ul").append(d.draggable)}else{a.before(d.draggable)}a.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var c=d.draggable.attr("value");var b=a.attr("value");a.find("#menu-"+c).find("#parent"+c).val(b);$(this).parent().find("dt").removeAttr("style");$(this).parent().find("div:first").removeAttr("style")},over:function(){if($(this).attr("class")=="dropzone ui-droppable"){$(this).parent().find("div:first").css("background","none").css("height","50px")}else{if($(this).attr("class")=="ui-droppable"){$(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}var a=$(this).parent().attr("id")},out:function(){$(this).parent().find("dt").removeAttr("style");$(this).parent().find("div:first").removeAttr("style");$(this).filter(".dropzone").css({borderColor:""})},deactivate:function(){}});$("#save_top").click(function(){updatepostdata()});$("#save_bottom").click(function(){updatepostdata()})});
\ No newline at end of file
+jQuery(function(a){a("#dialog-confirm").dialog({autoOpen:false,resizable:false,height:210,width:400,modal:true,buttons:{Save:function(){titletosave=a("#edittitle").attr("value");linktosave=a("#editlink").attr("value");anchortitletosave=a("#editanchortitle").attr("value");newwindowtosave=a("#editnewwindow").attr("value");desctosave=a("#editdescription").attr("value");a("#title"+a(this).dialog("option","itemID")).attr("value",titletosave);a("#linkurl"+a(this).dialog("option","itemID")).attr("value",linktosave);a("#anchortitle"+a(this).dialog("option","itemID")).attr("value",anchortitletosave);a("#newwindow"+a(this).dialog("option","itemID")).attr("value",newwindowtosave);a("#description"+a(this).dialog("option","itemID")).attr("value",desctosave);a("#menu-"+a(this).dialog("option","itemID")+" > dl > dt > span.title").text(titletosave);a("#view"+ +a(this).dialog("option","itemID")).attr("href",linktosave);a(this).dialog("close")},Cancel:function(){a(this).dialog("close")}}});a("#message").animate({opacity:1},2000).fadeOut(300,function(){a(this).remove()});a("#custom-nav li").prepend('
');a("#custom-nav li").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});a("#custom-nav dl, #custom-nav .dropzone").droppable({accept:"#custom-nav li",tolerance:"pointer",drop:function(g,f){var b=a(this).parent();var h=!a(this).hasClass("dropzone");if(h&&b.children("ul").length==0){b.append('')}if(h){b.children("ul").append(f.draggable)}else{b.before(f.draggable)}b.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var d=f.draggable.attr("value");var c=b.attr("value");b.find("#menu-"+d).find("#parent"+d).val(c);a(this).parent().find("dt").removeAttr("style");a(this).parent().find("div:first").removeAttr("style")},over:function(){if(a(this).attr("class")=="dropzone ui-droppable"){a(this).parent().find("div:first").css("background","none").css("height","50px")}else{if(a(this).attr("class")=="ui-droppable"){a(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}var b=a(this).parent().attr("id")},out:function(){a(this).parent().find("dt").removeAttr("style");a(this).parent().find("div:first").removeAttr("style");a(this).filter(".dropzone").css({borderColor:""})},deactivate:function(){}});a("#save_top").click(function(){updatepostdata()});a("#save_bottom").click(function(){updatepostdata()})});
\ No newline at end of file
diff --git a/wp-admin/js/custom-navigation-dynamic-functions.dev.js b/wp-admin/js/custom-navigation-dynamic-functions.dev.js
index 6565137d27..d3214600c4 100644
--- a/wp-admin/js/custom-navigation-dynamic-functions.dev.js
+++ b/wp-admin/js/custom-navigation-dynamic-functions.dev.js
@@ -34,21 +34,21 @@ function removeitem(o)
function edititem(o)
{
- itemTitle = $('#title' + o).attr('value');
- itemURL = $('#linkurl' + o).attr('value');
- itemAnchorTitle = $('#anchortitle' + o).attr('value');
- itemNewWindow = $('#newwindow' + o).attr('value');
- itemDesc = $('#description' + o).attr('value');
+ itemTitle = jQuery('#title' + o).attr('value');
+ itemURL = jQuery('#linkurl' + o).attr('value');
+ itemAnchorTitle = jQuery('#anchortitle' + o).attr('value');
+ itemNewWindow = jQuery('#newwindow' + o).attr('value');
+ itemDesc = jQuery('#description' + o).attr('value');
- $('#dialog-confirm').dialog( 'option' , 'itemID' , o )
+ jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o )
- $('#dialog-confirm').dialog('open');
+ jQuery('#dialog-confirm').dialog('open');
- $('#edittitle').attr('value', itemTitle);
- $('#editlink').attr('value', itemURL);
- $('#editanchortitle').attr('value', itemAnchorTitle);
- $("#editnewwindow option[value='" + itemNewWindow + "']").attr('selected', 'selected');
- $('#editdescription').attr('value', itemDesc);
+ jQuery('#edittitle').attr('value', itemTitle);
+ jQuery('#editlink').attr('value', itemURL);
+ jQuery('#editanchortitle').attr('value', itemAnchorTitle);
+ jQuery("#editnewwindow option[value='" + itemNewWindow + "']").attr('selected', 'selected');
+ jQuery('#editdescription').attr('value', itemDesc);
};
@@ -59,24 +59,24 @@ function updatepostdata()
{
var i = 0;
- $("#custom-nav").find("li").each(function(i) {
+ jQuery("#custom-nav").find("li").each(function(i) {
i = i + 1;
- var j = $(this).attr('value');
+ var j = jQuery(this).attr('value');
- $(this).find('#position' + j).attr('value', i);
- $(this).attr('id','menu-' + i);
- $(this).attr('value', i);
+ jQuery(this).find('#position' + j).attr('value', i);
+ jQuery(this).attr('id','menu-' + i);
+ jQuery(this).attr('value', i);
- $(this).find('#dbid' + j).attr('name','dbid' + i);
- $(this).find('#dbid' + j).attr('id','dbid' + i);
+ jQuery(this).find('#dbid' + j).attr('name','dbid' + i);
+ jQuery(this).find('#dbid' + j).attr('id','dbid' + i);
- $(this).find('#postmenu' + j).attr('name','postmenu' + i);
- $(this).find('#postmenu' + j).attr('id','postmenu' + i);
+ jQuery(this).find('#postmenu' + j).attr('name','postmenu' + i);
+ jQuery(this).find('#postmenu' + j).attr('id','postmenu' + i);
- var p = $(this).find('#parent' + j).parent().parent().parent().attr('value');
+ var p = jQuery(this).find('#parent' + j).parent().parent().parent().attr('value');
- $(this).find('#parent' + j).attr('name','parent' + i);
- $(this).find('#parent' + j).attr('id','parent' + i);
+ jQuery(this).find('#parent' + j).attr('name','parent' + i);
+ jQuery(this).find('#parent' + j).attr('id','parent' + i);
if (p) {
//Do nothing
}
@@ -85,37 +85,37 @@ function updatepostdata()
p = 0;
}
- $(this).find('#parent' + j).attr('value', p);
+ jQuery(this).find('#parent' + j).attr('value', p);
- $(this).find('#title' + j).attr('name','title' + i);
- $(this).find('#title' + j).attr('id','title' + i);
+ jQuery(this).find('#title' + j).attr('name','title' + i);
+ jQuery(this).find('#title' + j).attr('id','title' + i);
- $(this).find('#linkurl' + j).attr('name','linkurl' + i);
- $(this).find('#linkurl' + j).attr('id','linkurl' + i);
+ jQuery(this).find('#linkurl' + j).attr('name','linkurl' + i);
+ jQuery(this).find('#linkurl' + j).attr('id','linkurl' + i);
- $(this).find('#description' + j).attr('name','description' + i);
- $(this).find('#description' + j).attr('id','description' + i);
+ jQuery(this).find('#description' + j).attr('name','description' + i);
+ jQuery(this).find('#description' + j).attr('id','description' + i);
- $(this).find('#icon' + j).attr('name','icon' + i);
- $(this).find('#icon' + j).attr('id','icon' + i);
+ jQuery(this).find('#icon' + j).attr('name','icon' + i);
+ jQuery(this).find('#icon' + j).attr('id','icon' + i);
- $(this).find('#position' + j).attr('name','position' + i);
- $(this).find('#position' + j).attr('id','position' + i);
+ jQuery(this).find('#position' + j).attr('name','position' + i);
+ jQuery(this).find('#position' + j).attr('id','position' + i);
- $(this).find('#linktype' + j).attr('name','linktype' + i);
- $(this).find('#linktype' + j).attr('id','linktype' + i);
+ jQuery(this).find('#linktype' + j).attr('name','linktype' + i);
+ jQuery(this).find('#linktype' + j).attr('id','linktype' + i);
- $(this).find('#anchortitle' + j).attr('name','anchortitle' + i);
- $(this).find('#anchortitle' + j).attr('id','anchortitle' + i);
+ jQuery(this).find('#anchortitle' + j).attr('name','anchortitle' + i);
+ jQuery(this).find('#anchortitle' + j).attr('id','anchortitle' + i);
- $(this).find('#newwindow' + j).attr('name','newwindow' + i);
- $(this).find('#newwindow' + j).attr('id','newwindow' + i);
+ jQuery(this).find('#newwindow' + j).attr('name','newwindow' + i);
+ jQuery(this).find('#newwindow' + j).attr('id','newwindow' + i);
- $(this).find('dl > dt > span > #remove' + j).attr('value', i);
- $(this).find('dl > dt > span > #remove' + j).attr('onClick', 'removeitem(' + i + ')');
- $(this).find('dl > dt > span > #remove' + j).attr('id','remove' + i);
+ jQuery(this).find('dl > dt > span > #remove' + j).attr('value', i);
+ jQuery(this).find('dl > dt > span > #remove' + j).attr('onClick', 'removeitem(' + i + ')');
+ jQuery(this).find('dl > dt > span > #remove' + j).attr('id','remove' + i);
- $('#licount').attr('value',i);
+ jQuery('#licount').attr('value',i);
});
@@ -210,14 +210,14 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
}
//Notification Message
- $('.maintitle').after('
');
- $('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ $(this).remove();});
+ jQuery('.maintitle').after('
');
+ jQuery('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ jQuery(this).remove();});
//Appends HTML to the menu
- $('#custom-nav').append('
' + inputvaluevarname + ' ' + additemtype + ' ' + inputvaluevarname + ' ');
+ jQuery('#custom-nav').append('
' + inputvaluevarname + ' ' + additemtype + ' ' + inputvaluevarname + ' ');
//make menu item draggable
- $('#menu-' + randomnumber + '').draggable(
+ jQuery('#menu-' + randomnumber + '').draggable(
{
handle: ' > dl',
opacity: .8,
@@ -227,13 +227,13 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
});
//make menu item droppable
- $('#menu-' + randomnumber + ' dl, #menu-' + randomnumber + ' .dropzone').droppable({
+ jQuery('#menu-' + randomnumber + ' dl, #menu-' + randomnumber + ' .dropzone').droppable({
accept: '#' + randomnumber + ', #custom-nav li',
tolerance: 'pointer',
drop: function(e, ui)
{
- var li = $(this).parent();
- var child = !$(this).hasClass('dropzone');
+ var li = jQuery(this).parent();
+ var child = !jQuery(this).hasClass('dropzone');
//Append UL to first child
if (child && li.children('ul').length == 0)
{
@@ -254,34 +254,34 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
var draggablevalue = ui.draggable.attr('value');
var droppablevalue = li.attr('value');
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
- $(this).parent().find("dt").removeAttr('style');
- $(this).parent().find("div:first").removeAttr('style');
+ jQuery(this).parent().find("dt").removeAttr('style');
+ jQuery(this).parent().find("div:first").removeAttr('style');
},
over: function()
{
//Add child
- if ($(this).attr('class') == 'dropzone ui-droppable')
+ if (jQuery(this).attr('class') == 'dropzone ui-droppable')
{
- $(this).parent().find("div:first").css('background', 'none').css('height', '50px');
+ jQuery(this).parent().find("div:first").css('background', 'none').css('height', '50px');
}
//Add above
- else if ($(this).attr('class') == 'ui-droppable')
+ else if (jQuery(this).attr('class') == 'ui-droppable')
{
- $(this).parent().find("dt:first").css('background', '#d8d8d8');
+ jQuery(this).parent().find("dt:first").css('background', '#d8d8d8');
}
//do nothing
else {
}
- var parentid = $(this).parent().attr('id');
+ var parentid = jQuery(this).parent().attr('id');
},
out: function()
{
- $(this).parent().find("dt").removeAttr('style');
- $(this).parent().find("div:first").removeAttr('style');
- $(this).filter('.dropzone').css({ borderColor: '' });
+ jQuery(this).parent().find("dt").removeAttr('style');
+ jQuery(this).parent().find("div:first").removeAttr('style');
+ jQuery(this).filter('.dropzone').css({ borderColor: '' });
}
});
diff --git a/wp-admin/js/custom-navigation-dynamic-functions.js b/wp-admin/js/custom-navigation-dynamic-functions.js
index 88eb03a576..56a182c27e 100644
--- a/wp-admin/js/custom-navigation-dynamic-functions.js
+++ b/wp-admin/js/custom-navigation-dynamic-functions.js
@@ -1 +1 @@
-function removeitem(c){var b=document.getElementById("menu-"+c);if(b){var a=document.getElementById("menu-"+c).parentNode;throwaway_node=a.removeChild(b)}updatepostdata()}function edititem(a){itemTitle=$("#title"+a).attr("value");itemURL=$("#linkurl"+a).attr("value");itemAnchorTitle=$("#anchortitle"+a).attr("value");itemNewWindow=$("#newwindow"+a).attr("value");itemDesc=$("#description"+a).attr("value");$("#dialog-confirm").dialog("option","itemID",a);$("#dialog-confirm").dialog("open");$("#edittitle").attr("value",itemTitle);$("#editlink").attr("value",itemURL);$("#editanchortitle").attr("value",itemAnchorTitle);$("#editnewwindow option[value='"+itemNewWindow+"']").attr("selected","selected");$("#editdescription").attr("value",itemDesc)}function updatepostdata(){var a=0;$("#custom-nav").find("li").each(function(c){c=c+1;var b=$(this).attr("value");$(this).find("#position"+b).attr("value",c);$(this).attr("id","menu-"+c);$(this).attr("value",c);$(this).find("#dbid"+b).attr("name","dbid"+c);$(this).find("#dbid"+b).attr("id","dbid"+c);$(this).find("#postmenu"+b).attr("name","postmenu"+c);$(this).find("#postmenu"+b).attr("id","postmenu"+c);var d=$(this).find("#parent"+b).parent().parent().parent().attr("value");$(this).find("#parent"+b).attr("name","parent"+c);$(this).find("#parent"+b).attr("id","parent"+c);if(d){}else{d=0}$(this).find("#parent"+b).attr("value",d);$(this).find("#title"+b).attr("name","title"+c);$(this).find("#title"+b).attr("id","title"+c);$(this).find("#linkurl"+b).attr("name","linkurl"+c);$(this).find("#linkurl"+b).attr("id","linkurl"+c);$(this).find("#description"+b).attr("name","description"+c);$(this).find("#description"+b).attr("id","description"+c);$(this).find("#icon"+b).attr("name","icon"+c);$(this).find("#icon"+b).attr("id","icon"+c);$(this).find("#position"+b).attr("name","position"+c);$(this).find("#position"+b).attr("id","position"+c);$(this).find("#linktype"+b).attr("name","linktype"+c);$(this).find("#linktype"+b).attr("id","linktype"+c);$(this).find("#anchortitle"+b).attr("name","anchortitle"+c);$(this).find("#anchortitle"+b).attr("id","anchortitle"+c);$(this).find("#newwindow"+b).attr("name","newwindow"+c);$(this).find("#newwindow"+b).attr("id","newwindow"+c);$(this).find("dl > dt > span > #remove"+b).attr("value",c);$(this).find("dl > dt > span > #remove"+b).attr("onClick","removeitem("+c+")");$(this).find("dl > dt > span > #remove"+b).attr("id","remove"+c);$("#licount").attr("value",c)})}function appendToList(b,s,d,n,h,l,e){var k="";var c="";var r="";var o="";var i="";var a="";if(s=="Custom"){k=document.getElementById("custom_menu_item_name").value;c=document.getElementById("custom_menu_item_url").value;r="";o="";inputlinktype="custom";i=document.getElementById("custom_menu_item_description").value}else{if(s=="Page"){k=htmlentities(d.toString());c=n.toString();r=h.toString();o="0";inputlinktype="page";i=htmlentities(e.toString())}else{if(s=="Category"){k=htmlentities(d.toString());c=n.toString();r=h.toString();o="0";inputlinktype="category";i=htmlentities(e.toString())}else{k="";k="";r="";o="";inputlinktype="custom";i=""}}}var g=document.getElementById("custom-nav").getElementsByTagName("li").length;var p=g;var m=0;try{var q=document.getElementById("menu-"+p.toString()).value}catch(f){m=1}while(m==0){p=p+1;try{var j=document.getElementById("menu-"+p.toString()).value}catch(f){m=1}}$(".maintitle").after('
');$("#message").animate({opacity:1},2000).fadeOut(300,function(){$(this).remove()});$("#custom-nav").append('');$("#menu-"+p+"").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});$("#menu-"+p+" dl, #menu-"+p+" .dropzone").droppable({accept:"#"+p+", #custom-nav li",tolerance:"pointer",drop:function(x,w){var t=$(this).parent();var y=!$(this).hasClass("dropzone");if(y&&t.children("ul").length==0){t.append("
")}if(y){t.children("ul").append(w.draggable)}else{t.before(w.draggable)}t.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var v=w.draggable.attr("value");var u=t.attr("value");t.find("#menu-"+v).find("#parent"+v).val(u);$(this).parent().find("dt").removeAttr("style");$(this).parent().find("div:first").removeAttr("style")},over:function(){if($(this).attr("class")=="dropzone ui-droppable"){$(this).parent().find("div:first").css("background","none").css("height","50px")}else{if($(this).attr("class")=="ui-droppable"){$(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}var t=$(this).parent().attr("id")},out:function(){$(this).parent().find("dt").removeAttr("style");$(this).parent().find("div:first").removeAttr("style");$(this).filter(".dropzone").css({borderColor:""})}});updatepostdata()};
\ No newline at end of file
+function removeitem(c){var b=document.getElementById("menu-"+c);if(b){var a=document.getElementById("menu-"+c).parentNode;throwaway_node=a.removeChild(b)}updatepostdata()}function edititem(a){itemTitle=jQuery("#title"+a).attr("value");itemURL=jQuery("#linkurl"+a).attr("value");itemAnchorTitle=jQuery("#anchortitle"+a).attr("value");itemNewWindow=jQuery("#newwindow"+a).attr("value");itemDesc=jQuery("#description"+a).attr("value");jQuery("#dialog-confirm").dialog("option","itemID",a);jQuery("#dialog-confirm").dialog("open");jQuery("#edittitle").attr("value",itemTitle);jQuery("#editlink").attr("value",itemURL);jQuery("#editanchortitle").attr("value",itemAnchorTitle);jQuery("#editnewwindow option[value='"+itemNewWindow+"']").attr("selected","selected");jQuery("#editdescription").attr("value",itemDesc)}function updatepostdata(){var a=0;jQuery("#custom-nav").find("li").each(function(c){c=c+1;var b=jQuery(this).attr("value");jQuery(this).find("#position"+b).attr("value",c);jQuery(this).attr("id","menu-"+c);jQuery(this).attr("value",c);jQuery(this).find("#dbid"+b).attr("name","dbid"+c);jQuery(this).find("#dbid"+b).attr("id","dbid"+c);jQuery(this).find("#postmenu"+b).attr("name","postmenu"+c);jQuery(this).find("#postmenu"+b).attr("id","postmenu"+c);var d=jQuery(this).find("#parent"+b).parent().parent().parent().attr("value");jQuery(this).find("#parent"+b).attr("name","parent"+c);jQuery(this).find("#parent"+b).attr("id","parent"+c);if(d){}else{d=0}jQuery(this).find("#parent"+b).attr("value",d);jQuery(this).find("#title"+b).attr("name","title"+c);jQuery(this).find("#title"+b).attr("id","title"+c);jQuery(this).find("#linkurl"+b).attr("name","linkurl"+c);jQuery(this).find("#linkurl"+b).attr("id","linkurl"+c);jQuery(this).find("#description"+b).attr("name","description"+c);jQuery(this).find("#description"+b).attr("id","description"+c);jQuery(this).find("#icon"+b).attr("name","icon"+c);jQuery(this).find("#icon"+b).attr("id","icon"+c);jQuery(this).find("#position"+b).attr("name","position"+c);jQuery(this).find("#position"+b).attr("id","position"+c);jQuery(this).find("#linktype"+b).attr("name","linktype"+c);jQuery(this).find("#linktype"+b).attr("id","linktype"+c);jQuery(this).find("#anchortitle"+b).attr("name","anchortitle"+c);jQuery(this).find("#anchortitle"+b).attr("id","anchortitle"+c);jQuery(this).find("#newwindow"+b).attr("name","newwindow"+c);jQuery(this).find("#newwindow"+b).attr("id","newwindow"+c);jQuery(this).find("dl > dt > span > #remove"+b).attr("value",c);jQuery(this).find("dl > dt > span > #remove"+b).attr("onClick","removeitem("+c+")");jQuery(this).find("dl > dt > span > #remove"+b).attr("id","remove"+c);jQuery("#licount").attr("value",c)})}function appendToList(b,s,d,n,h,l,e){var k="";var c="";var r="";var o="";var i="";var a="";if(s=="Custom"){k=document.getElementById("custom_menu_item_name").value;c=document.getElementById("custom_menu_item_url").value;r="";o="";inputlinktype="custom";i=document.getElementById("custom_menu_item_description").value}else{if(s=="Page"){k=htmlentities(d.toString());c=n.toString();r=h.toString();o="0";inputlinktype="page";i=htmlentities(e.toString())}else{if(s=="Category"){k=htmlentities(d.toString());c=n.toString();r=h.toString();o="0";inputlinktype="category";i=htmlentities(e.toString())}else{k="";k="";r="";o="";inputlinktype="custom";i=""}}}var g=document.getElementById("custom-nav").getElementsByTagName("li").length;var p=g;var m=0;try{var q=document.getElementById("menu-"+p.toString()).value}catch(f){m=1}while(m==0){p=p+1;try{var j=document.getElementById("menu-"+p.toString()).value}catch(f){m=1}}jQuery(".maintitle").after('
');jQuery("#message").animate({opacity:1},2000).fadeOut(300,function(){jQuery(this).remove()});jQuery("#custom-nav").append('');jQuery("#menu-"+p+"").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});jQuery("#menu-"+p+" dl, #menu-"+p+" .dropzone").droppable({accept:"#"+p+", #custom-nav li",tolerance:"pointer",drop:function(x,w){var t=jQuery(this).parent();var y=!jQuery(this).hasClass("dropzone");if(y&&t.children("ul").length==0){t.append("
")}if(y){t.children("ul").append(w.draggable)}else{t.before(w.draggable)}t.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var v=w.draggable.attr("value");var u=t.attr("value");t.find("#menu-"+v).find("#parent"+v).val(u);jQuery(this).parent().find("dt").removeAttr("style");jQuery(this).parent().find("div:first").removeAttr("style")},over:function(){if(jQuery(this).attr("class")=="dropzone ui-droppable"){jQuery(this).parent().find("div:first").css("background","none").css("height","50px")}else{if(jQuery(this).attr("class")=="ui-droppable"){jQuery(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}var t=jQuery(this).parent().attr("id")},out:function(){jQuery(this).parent().find("dt").removeAttr("style");jQuery(this).parent().find("div:first").removeAttr("style");jQuery(this).filter(".dropzone").css({borderColor:""})}});updatepostdata()};
\ No newline at end of file
diff --git a/wp-includes/custom-navigation.php b/wp-includes/custom-navigation.php
index 78c080d79b..c564e0db64 100644
--- a/wp-includes/custom-navigation.php
+++ b/wp-includes/custom-navigation.php
@@ -13,14 +13,14 @@
function wp_custom_navigation_get_menu_items( $menu_objects, $key = 'ID' ) {
$menu_items = array();
if ( !empty( $menu_objects ) && !empty( $key ) ) {
- $args = array( 'orderby' => 'menu_order', 'post_type' => 'menu_item', 'post_status' => 'menu-category,menu-page,menu-custom' );
+ $args = array( 'orderby' => 'menu_order', 'post_type' => 'menu_item', 'post_status' => 'publish' );
if ( count( $menu_objects ) > 1 )
$args['include'] = implode( ',', $menu_objects );
else
$args['include'] = $menu_objects[0];
- $posts = new WP_Query( $args );
- if ( ! empty( $posts->posts ) ) {
- foreach( $posts->posts as $post ) {
+ $posts = get_posts( $args );
+ if ( ! empty( $posts ) ) {
+ foreach ( $posts as $post ) {
$menu_items[ $post->$key ] = $post;
}
}
@@ -29,6 +29,7 @@ function wp_custom_navigation_get_menu_items( $menu_objects, $key = 'ID' ) {
}
return $menu_items;
}
+
function wp_custom_navigation_setup($override = false) {
$nav_version = '1.1.0';
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index 82ef10c857..b132db3068 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -403,9 +403,9 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'custom-navigation-ui-custom', '/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js', array('jquery'), '1.7.2' );
$scripts->add_data( 'custom-navigation-ui-custom', 'group', 1 );
- $scripts->add( 'custom-navigation-default-items', '/wp-admin/js/custom-navigation-default-items.js', false, '1.0.0' );
- $scripts->add( 'custom-navigation-dynamic-functions', '/wp-admin/js/custom-navigation-dynamic-functions.js', false, '1.0.0' );
- $scripts->add( 'custom-navigation-php-functions', '/wp-admin/js/custom-navigation-php-functions.js', false, '1.0.0' );
+ $scripts->add( 'custom-navigation-default-items', "/wp-admin/js/custom-navigation-default-items$suffix.js", false, '20100220' );
+ $scripts->add( 'custom-navigation-dynamic-functions', "/wp-admin/js/custom-navigation-dynamic-functions$suffix.js", false, '20100220' );
+ $scripts->add( 'custom-navigation-php-functions', "/wp-admin/js/custom-navigation-php-functions$suffix.js", false, '20100220' );
}