<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13974] trunk: Don't use target="_self" in nav menu links,
just omit the attribute.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13974">13974</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-04-03 22:52:30 +0000 (Sat, 03 Apr 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Don't use target="_self" in nav menu links, just omit the attribute. Also fix and run earlier db upgrades. fixes <a href="http://trac.wordpress.org/ticket/12808">#12808</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpadminjsnavmenudevjs">trunk/wp-admin/js/nav-menu.dev.js</a></li>
<li><a href="#trunkwpadminjsnavmenujs">trunk/wp-admin/js/nav-menu.js</a></li>
<li><a href="#trunkwpadminnavmenusphp">trunk/wp-admin/nav-menus.php</a></li>
<li><a href="#trunkwpincludesclassesphp">trunk/wp-includes/classes.php</a></li>
<li><a href="#trunkwpincludesnavmenutemplatephp">trunk/wp-includes/nav-menu-template.php</a></li>
<li><a href="#trunkwpincludesnavmenuphp">trunk/wp-includes/nav-menu.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
<li><a href="#trunkwpincludesversionphp">trunk/wp-includes/version.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-admin/admin-ajax.php        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -1416,7 +1416,7 @@
</span><span class="cx">         update_post_meta( $link_id, '_menu_item_type', 'custom' );
</span><span class="cx">         update_post_meta( $link_id, '_menu_item_object_id', (int) $link_id );
</span><span class="cx">         update_post_meta( $link_id, '_menu_item_object', 'custom' );
</span><del>-        update_post_meta( $link_id, '_menu_item_target', '_self' );
</del><ins>+        update_post_meta( $link_id, '_menu_item_target', '' );
</ins><span class="cx">         update_post_meta( $link_id, '_menu_item_classes', '' );
</span><span class="cx">         update_post_meta( $link_id, '_menu_item_xfn', '' );
</span><span class="cx">         update_post_meta( $link_id, '_menu_item_url', $link_url );
</span></span></pre></div>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-admin/includes/upgrade.php        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -440,7 +440,7 @@
</span><span class="cx">         if ( $wp_current_db_version < 11958 )
</span><span class="cx">                 upgrade_290();
</span><span class="cx">
</span><del>-        if ( $wp_current_db_version < 12751 )
</del><ins>+        if ( $wp_current_db_version < 13974 )
</ins><span class="cx">                 upgrade_300();
</span><span class="cx">
</span><span class="cx">         maybe_disable_automattic_widgets();
</span><span class="lines">@@ -1114,25 +1114,21 @@
</span><span class="cx">                         add_site_option( 'siteurl', '' );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        // 3.0-alpha nav menu postmeta changes. can be removed before release
-        if ( $wp_current_db_version >= 13226 && $wp_current_db_version < 13802 ) {
-                // remove old nav menu post meta keys
-                $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN( 'menu_type', 'object_id', 'menu_new_window', 'menu_link', '_menu_item_append', 'menu_item_append' )" );
-                // update nav menu post meta keys to underscore prefixes
-                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_type' ), array( 'meta_key' => 'menu_item_type' ) );
-                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_object_id' ), array( 'meta_key' => 'menu_item_object_id' ) );
-                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_target' ), array( 'meta_key' => 'menu_item_target' ) );
-                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_classes' ), array( 'meta_key' => 'menu_item_classes' ) );
-                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_xfn' ), array( 'meta_key' => 'menu_item_xfn' ) );
-                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_url' ), array( 'meta_key' => 'menu_item_url' ) );
-        }
</del><ins>+        // 3.0-alpha nav menu postmeta changes. can be removed before release. // r13802
+        if ( $wp_current_db_version >= 13226 && $wp_current_db_version < 13974 )
+                $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN( 'menu_type', 'object_id', 'menu_new_window', 'menu_link', '_menu_item_append', 'menu_item_append', 'menu_item_type', 'menu_item_object_id', 'menu_item_target', 'menu_item_classes', 'menu_item_xfn', 'menu_item_url' )" );
</ins><span class="cx">
</span><del>-        // 3.0-beta1 remove_user primitive->meta cap. can be removed before release
-        if ( $wp_current_db_version >= 12751 && $wp_current_db_version < 12751 ) {
</del><ins>+        // 3.0-beta1 remove_user primitive->meta cap. can be removed before release. r13956
+        if ( $wp_current_db_version >= 12751 && $wp_current_db_version < 13974 ) {
</ins><span class="cx">                 $role =& get_role( 'administrator' );
</span><span class="cx">                 if ( ! empty( $role ) )
</span><span class="cx">                         $role->remove_cap( 'remove_user' );
</span><span class="cx">         }
</span><ins>+
+        // 3.0-beta1 nav menu postmeta changes. can be removed before release. r13974
+        if ( $wp_current_db_version >= 13802 && $wp_current_db_version < 13974 )
+                $wpdb->update( $wpdb->postmeta, array( 'meta_value' => '' ), array( 'meta_key' => '_menu_item_target', 'meta_value' => '_self' ) );
+
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkwpadminjsnavmenudevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/nav-menu.dev.js (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/nav-menu.dev.js        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-admin/js/nav-menu.dev.js        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx">                                 if ( '-1' == link_id )
</span><span class="cx">                                         return;
</span><span class="cx">
</span><del>-                                wpNavMenu.add_to_menu( link_id, link_id, 'custom', 'custom', navMenuL10n.custom, 0, link_name, link_url, '', '', '_self', '', '' );
</del><ins>+                                wpNavMenu.add_to_menu( link_id, link_id, 'custom', 'custom', navMenuL10n.custom, 0, link_name, link_url, '', '', '', '', '' );
</ins><span class="cx">                         }, 'json');
</span><span class="cx">                 },
</span><span class="cx">                 
</span><span class="lines">@@ -429,7 +429,7 @@
</span><span class="cx">                                         var item_xfn = $(this).parent().siblings('.menu-item-xfn').val();
</span><span class="cx">                                 } else {
</span><span class="cx">                                         var item_attr_title = '';
</span><del>-                                        var item_target = '_self';
</del><ins>+                                        var item_target = '';
</ins><span class="cx">                                         var item_classes = '';
</span><span class="cx">                                         var item_xfn = '';
</span><span class="cx">                                 };
</span></span></pre></div>
<a id="trunkwpadminjsnavmenujs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/nav-menu.js (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/nav-menu.js        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-admin/js/nav-menu.js        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var wpNavMenu;(function(a){wpNavMenu={init:function(){wpNavMenu.initial_meta_boxes();wpNavMenu.drag_and_drop();a("#update-nav-menu .deletion").click(function(){if(confirm(navMenuL10n.warnDelete)){return true}else{return false}});a("#update-nav-menu").submit(function(){wpNavMenu.update_post_data()});a("#create-menu-name").keypress(function(b){if(13==b.keyCode){a("#create-menu-button").click();return false}});a("#custom-menu-item-url, #custom-menu-item-name").keypress(function(b){if(13==b.keyCode){a("#add-custom-links a.button").click();return false}}).focus(function(){if(a(this).val()==a(this).attr("defaultValue")&&a(this).attr("id")!="custom-menu-item-url"){a(this).val("")}}).blur(function(){if(a(this).val()==""){a(this).val(a(this).attr("defaultValue"))}});a("#create-menu-name").focus(function(){if(a(this).val()==a(this).attr("defaultValue")){a(this).val("")}}).blur(function(){if(a(this).val()==""){a(this).val(a(this).attr("defaultValue"))}});a(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles("nav-menus");a(".quick-search").click(function(){a(this).attr("value","")});a(".quick-search-submit").click(function(){a(this).siblings(".quick-search").search()});a("#menu-container .item-edit").click(function(){wpNavMenu.edit_menu_item(a(this).attr("value"))});a("#menu-container .item-delete").click(function(){wpNavMenu.remove_menu_item(a(this).attr("value"))});a("#update-menu-item").click(function(){wpNavMenu.update_menu_item();tb_remove()});a("#cancel-save").click(function(){tb_remove()});a(".show-all").click(function(b){a(b.currentTarget).parent().parent().siblings(".list-wrap").css("display","block");a(b.currentTarget).parent().parent().siblings(".list-wrap").find("li").css("display","block");a(b.currentTarget).hide();a(b.currentTarget).siblings(".hide-all").show()});a(".hide-all").click(function(b){a(b.currentTarget).parent().parent().siblings(".list-wrap").css("display","none");a(b.currentTarget).parent().parent().siblings(".list-wrap").find("li").css("display","none");a(b.currentTarget).hide();a(b.currentTarget).siblings(".show-all").show()});a(".add-to-menu").click(function(b){wpNavMenu.add_checked_items_to_menu(b.currentTarget)});a("#add-custom-links .add-to-menu a").click(function(b){if(a("#custom-menu-item-url").val()==a("#custom-menu-item-url").attr("defaultValue")){return}wpNavMenu.add_custom_link(a("#custom-menu-item-name").val(),a("#custom-menu-item-url").val());a("#custom-menu-item-name").val(a("#custom-menu-item-name").attr("defaultValue"));a("#custom-menu-item-url").val(a("#custom-menu-item-url").attr("defaultValue")).focus()})},add_custom_link:function(c,b){var d={action:"save-custom-link",link_name:c,link_url:b};a.post(ajaxurl,d,function(e){if("-1"==e){return}wpNavMenu.add_to_menu(e,e,"custom","custom",navMenuL10n.custom,0,c,b,"","","_self","","")},"json")},initial_meta_boxes:function(){var c=a("#hidden-metaboxes").val().split(",");if(""!=c){for(var b=0;b<c.length;b++){a("#"+c[b]).attr("style","display: none;");a("#"+c[b]+"-hide").attr("checked",false)}}},drag_and_drop:function(){a(".menu li").each(function(){if(!a(this).children(".dropzone").attr("class")){a(this).prepend('<div class="dropzone"></div>')}});a(".menu li").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});a(".menu li dl, .menu li .dropzone").droppable({accept:".menu li",tolerance:"pointer",drop:function(h,g){var b=a(this).parent();var j=!a(this).hasClass("dropzone");var f=b.children("input[name=menu-item-object-id[]]").val();var i=g.draggable.children("input[name=menu-item-object-id[]]").val();if(f==i){g.draggable.find("dt").animate({backgroundColor:"#FF3333"},{duration:"normal",complete:function(){a(this).css("backgroundColor","")}});a(this).parent().find("dt").removeAttr("style");return}if(j&&b.children("ul").length==0){b.append('<ul class="sub-menu" />')}if(j){b.children("ul").append(g.draggable)}else{b.before(g.draggable)}b.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var d=g.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(b){if(a(this).attr("class")=="dropzone ui-droppable"){a(this).parent().find("div:first").css({background:"#f5f5f5",border:"1px dashed #bbb",margin:"10px 0px",height:"40px"})}else{if(a(this).attr("class")=="ui-droppable"){a(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}},out:function(){a(this).parent().find("dt").removeAttr("style");a(this).parent().find("div:first").removeAttr("style");a(this).filter(".dropzone").css({borderColor:""})}})},update_post_data:function(){var b=0;a(".menu li").each(function(){b=b+1;var d=a(this).attr("value");var e=a(this).children("input[name=menu-item-db-id[]]").val();a(this).attr("value",b);a(this).children("input[name=menu-item-position[]]").attr("value",b);var c=a(this).parent(".sub-menu").siblings("input[name=menu-item-object-id[]]").val();if(undefined==c){c=0}a(this).children("input[name=menu-item-parent-id[]]").attr("value",c);a("#li-count").attr("value",b)})},autocomplete:function(b){a("#add-"+b+" .quick-search").autocomplete(a("#add-"+b+" .autocomplete").val().split("|"));a("#add-"+b+" .quick-search").result(function(c,e,d){a("#add-"+b+" .list-wrap").css("display","block");a("#add-"+b+" .list-wrap li:contains('"+e+"')").css("display","block");a("#add-"+b+" .show-all").hide();a("#add-"+b+" .hide-all").show()})},edit_menu_item:function(b){var g=a("#menu-item-"+b).children("input[name=menu-item-type[]]").val();var c=a("#menu-item-"+b).children("input[name=menu-item-title[]]").val();var h=a("#menu-item-"+b).children("input[name=menu-item-url[]]").val();var d=a("#menu-item-"+b).children("input[name=menu-item-attr-title[]]").val();var e=a("#menu-item-"+b).children("input[name=menu-item-target[]]").val();var i=a("#menu-item-"+b).children("input[name=menu-item-description[]]").val();var f=a("#menu-item-"+b).children("input[name=menu-item-classes[]]").val();var j=a("#menu-item-"+b).children("input[name=menu-item-xfn[]]").val();if("custom"!=g){a("#edit-menu-item-url").attr("disabled","disabled")}a("#edit-menu-item-id").val(b);a("#edit-menu-item-title").val(c);a("#edit-menu-item-url").val(h);a("#edit-menu-item-attr-title").val(d);a("#edit-menu-item-target").val(e);a("#edit-menu-item-target option[value='"+e+"']").attr("selected","selected");a("#edit-menu-item-description").val(i);a("#edit-menu-item-classes").val(f);a("#edit-menu-item-xfn").val(j)},update_menu_item:function(){var i=a("#edit-menu-item-id").val();var g=a("#edit-menu-item-title").val();var c=a("#edit-menu-item-url").val();var h=a("#edit-menu-item-attr-title").val();var e=a("#edit-menu-item-target").val();var d=a("#edit-menu-item-description").val();var b=a("#edit-menu-item-classes").val();var f=a("#edit-menu-item-xfn").val();a(".menu #menu-item-"+i).find("span.item-title:first").html(g);a("#menu-item-"+i).children("input[name=menu-item-title[]]").val(g);a("#menu-item-"+i).children("input[name=menu-item-url[]]").val(c);a("#menu-item-"+i).children("input[name=menu-item-attr-title[]]").val(h);a("#menu-item-"+i).children("input[name=menu-item-target[]]").val(e);a("#menu-item-"+i).children("input[name=menu-item-description[]]").val(d);a("#menu-item-"+i).children("input[name=menu-item-classes[]]").val(b);a("#menu-item-"+i).children("input[name=menu-item-xfn[]]").val(f);a(".menu #menu-item-"+i+" dt:first").animate({backgroundColor:"#FFFF33"},{duration:"normal",complete:function(){a(this).css("backgroundColor","")}})},remove_menu_item:function(c){var b=a("#menu-item-"+c);if(b){a(b).find("dt").each(function(){a(this).animate({backgroundColor:"#FF3333"},{duration:"normal",complete:function(){a(this).parent().parent().remove()}})})}},add_to_menu:function(b,m,c,h,p,n,d,o,j,g,f,e,k){var l=a(".menu li").length+1;var i=wpNavMenu.get_hidden_inputs(l,b,m,c,h,n,d,o,j,g,f,e,k);a(".menu").append('<li id="menu-item-'+l+'" value="'+l+'"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="item-title">'+d+'</span><span class="item-controls"><span class="item-type">'+p+'</span><a class="item-edit thickbox" id="edit'+l+'" value="'+l+'" onclick="wpNavMenu.edit_menu_item('+l+');" title="'+navMenuL10n.thickbox+'" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">'+navMenuL10n.edit+'</a> | <a class="item-delete" id="delete'+l+'" value="'+l+'" onclick="wpNavMenu.remove_menu_item('+l+');">Delete</a></span></dt></dl>'+i+"</li>");a(".menu #menu-item-"+l+" dt:first").animate({backgroundColor:"#FFFF33"},{duration:"normal",complete:function(){a(this).css("backgroundColor","")}});wpNavMenu.drag_and_drop();tb_init("a.thickbox, area.thickbox, input.thickbox")},add_checked_items_to_menu:function(c){var b=a(c).parent().siblings(".list-wrap").find(":checked");if(0==b.length){return false}a(b).each(function(){var j=a(this).parent().siblings(".menu-item-type").val();if("custom"==j){var g=a(this).parent().siblings(".menu-item-attr-title").val();var h=a(this).parent().siblings(".menu-item-target").val();var i=a(this).parent().siblings(".menu-item-classes").val();var l=a(this).parent().siblings(".menu-item-xfn").val()}else{var g="";var h="_self";var i="";var l=""}var d=a(this).parent().siblings(".menu-item-db-id").val();var m=a(this).parent().siblings(".menu-item-object-id").val();var e=a(this).parent().siblings(".menu-item-object").val();var p=a(this).parent().siblings(".menu-item-append").val();var n=a(this).parent().siblings(".menu-item-parent-id").val();var f=a(this).parent().siblings(".menu-item-title").val();var o=a(this).parent().siblings(".menu-item-url").val();var k=a(this).parent().siblings(".menu-item-description").val();if(undefined==k){k=""}if(undefined==g){g=""}wpNavMenu.add_to_menu(d,m,e,j,p,n,f,o,k,g,h,i,l);a(this).attr("checked",false)})},get_hidden_inputs:function(l,b,m,c,h,n,d,o,j,g,f,e,k){var i="";i+='<input type="hidden" name="menu-item-db-id[]" value="'+b+'" />';i+='<input type="hidden" name="menu-item-object-id[]" value="'+m+'" />';i+='<input type="hidden" name="menu-item-object[]" value="'+c+'" />';i+='<input type="hidden" name="menu-item-type[]" value="'+h+'" />';i+='<input type="hidden" name="menu-item-parent-id[]" value="'+n+'" />';i+='<input type="hidden" name="menu-item-position[]" value="'+l+'" />';i+='<input type="hidden" name="menu-item-title[]" value="'+d+'" />';i+='<input type="hidden" name="menu-item-attr-title[]" value="'+g+'" />';i+='<input type="hidden" name="menu-item-url[]" value="'+o+'" />';i+='<input type="hidden" name="menu-item-target[]" value="'+f+'" />';i+='<input type="hidden" name="menu-item-description[]" value="'+j+'" />';i+='<input type="hidden" name="menu-item-classes[]" value="'+e+'" />';i+='<input type="hidden" name="menu-item-xfn[]" value="'+k+'" />';return i}};a(document).ready(function(b){wpNavMenu.init()})})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+var wpNavMenu;(function(a){wpNavMenu={init:function(){wpNavMenu.initial_meta_boxes();wpNavMenu.drag_and_drop();a("#update-nav-menu .deletion").click(function(){if(confirm(navMenuL10n.warnDelete)){return true}else{return false}});a("#update-nav-menu").submit(function(){wpNavMenu.update_post_data()});a("#create-menu-name").keypress(function(b){if(13==b.keyCode){a("#create-menu-button").click();return false}});a("#custom-menu-item-url, #custom-menu-item-name").keypress(function(b){if(13==b.keyCode){a("#add-custom-links a.button").click();return false}}).focus(function(){if(a(this).val()==a(this).attr("defaultValue")&&a(this).attr("id")!="custom-menu-item-url"){a(this).val("")}}).blur(function(){if(a(this).val()==""){a(this).val(a(this).attr("defaultValue"))}});a("#create-menu-name").focus(function(){if(a(this).val()==a(this).attr("defaultValue")){a(this).val("")}}).blur(function(){if(a(this).val()==""){a(this).val(a(this).attr("defaultValue"))}});a(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles("nav-menus");a(".quick-search").click(function(){a(this).attr("value","")});a(".quick-search-submit").click(function(){a(this).siblings(".quick-search").search()});a("#menu-container .item-edit").click(function(){wpNavMenu.edit_menu_item(a(this).attr("value"))});a("#menu-container .item-delete").click(function(){wpNavMenu.remove_menu_item(a(this).attr("value"))});a("#update-menu-item").click(function(){wpNavMenu.update_menu_item();tb_remove()});a("#cancel-save").click(function(){tb_remove()});a(".show-all").click(function(b){a(b.currentTarget).parent().parent().siblings(".list-wrap").css("display","block");a(b.currentTarget).parent().parent().siblings(".list-wrap").find("li").css("display","block");a(b.currentTarget).hide();a(b.currentTarget).siblings(".hide-all").show()});a(".hide-all").click(function(b){a(b.currentTarget).parent().parent().siblings(".list-wrap").css("display","none");a(b.currentTarget).parent().parent().siblings(".list-wrap").find("li").css("display","none");a(b.currentTarget).hide();a(b.currentTarget).siblings(".show-all").show()});a(".add-to-menu").click(function(b){wpNavMenu.add_checked_items_to_menu(b.currentTarget)});a("#add-custom-links .add-to-menu a").click(function(b){if(a("#custom-menu-item-url").val()==a("#custom-menu-item-url").attr("defaultValue")){return}wpNavMenu.add_custom_link(a("#custom-menu-item-name").val(),a("#custom-menu-item-url").val());a("#custom-menu-item-name").val(a("#custom-menu-item-name").attr("defaultValue"));a("#custom-menu-item-url").val(a("#custom-menu-item-url").attr("defaultValue")).focus()})},add_custom_link:function(c,b){var d={action:"save-custom-link",link_name:c,link_url:b};a.post(ajaxurl,d,function(e){if("-1"==e){return}wpNavMenu.add_to_menu(e,e,"custom","custom",navMenuL10n.custom,0,c,b,"","","","","")},"json")},initial_meta_boxes:function(){var c=a("#hidden-metaboxes").val().split(",");if(""!=c){for(var b=0;b<c.length;b++){a("#"+c[b]).attr("style","display: none;");a("#"+c[b]+"-hide").attr("checked",false)}}},drag_and_drop:function(){a(".menu li").each(function(){if(!a(this).children(".dropzone").attr("class")){a(this).prepend('<div class="dropzone"></div>')}});a(".menu li").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});a(".menu li dl, .menu li .dropzone").droppable({accept:".menu li",tolerance:"pointer",drop:function(h,g){var b=a(this).parent();var j=!a(this).hasClass("dropzone");var f=b.children("input[name=menu-item-object-id[]]").val();var i=g.draggable.children("input[name=menu-item-object-id[]]").val();if(f==i){g.draggable.find("dt").animate({backgroundColor:"#FF3333"},{duration:"normal",complete:function(){a(this).css("backgroundColor","")}});a(this).parent().find("dt").removeAttr("style");return}if(j&&b.children("ul").length==0){b.append('<ul class="sub-menu" />')}if(j){b.children("ul").append(g.draggable)}else{b.before(g.draggable)}b.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var d=g.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(b){if(a(this).attr("class")=="dropzone ui-droppable"){a(this).parent().find("div:first").css({background:"#f5f5f5",border:"1px dashed #bbb",margin:"10px 0px",height:"40px"})}else{if(a(this).attr("class")=="ui-droppable"){a(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}},out:function(){a(this).parent().find("dt").removeAttr("style");a(this).parent().find("div:first").removeAttr("style");a(this).filter(".dropzone").css({borderColor:""})}})},update_post_data:function(){var b=0;a(".menu li").each(function(){b=b+1;var d=a(this).attr("value");var e=a(this).children("input[name=menu-item-db-id[]]").val();a(this).attr("value",b);a(this).children("input[name=menu-item-position[]]").attr("value",b);var c=a(this).parent(".sub-menu").siblings("input[name=menu-item-object-id[]]").val();if(undefined==c){c=0}a(this).children("input[name=menu-item-parent-id[]]").attr("value",c);a("#li-count").attr("value",b)})},autocomplete:function(b){a("#add-"+b+" .quick-search").autocomplete(a("#add-"+b+" .autocomplete").val().split("|"));a("#add-"+b+" .quick-search").result(function(c,e,d){a("#add-"+b+" .list-wrap").css("display","block");a("#add-"+b+" .list-wrap li:contains('"+e+"')").css("display","block");a("#add-"+b+" .show-all").hide();a("#add-"+b+" .hide-all").show()})},edit_menu_item:function(b){var g=a("#menu-item-"+b).children("input[name=menu-item-type[]]").val();var c=a("#menu-item-"+b).children("input[name=menu-item-title[]]").val();var h=a("#menu-item-"+b).children("input[name=menu-item-url[]]").val();var d=a("#menu-item-"+b).children("input[name=menu-item-attr-title[]]").val();var e=a("#menu-item-"+b).children("input[name=menu-item-target[]]").val();var i=a("#menu-item-"+b).children("input[name=menu-item-description[]]").val();var f=a("#menu-item-"+b).children("input[name=menu-item-classes[]]").val();var j=a("#menu-item-"+b).children("input[name=menu-item-xfn[]]").val();if("custom"!=g){a("#edit-menu-item-url").attr("disabled","disabled")}a("#edit-menu-item-id").val(b);a("#edit-menu-item-title").val(c);a("#edit-menu-item-url").val(h);a("#edit-menu-item-attr-title").val(d);a("#edit-menu-item-target").val(e);a("#edit-menu-item-target option[value='"+e+"']").attr("selected","selected");a("#edit-menu-item-description").val(i);a("#edit-menu-item-classes").val(f);a("#edit-menu-item-xfn").val(j)},update_menu_item:function(){var i=a("#edit-menu-item-id").val();var g=a("#edit-menu-item-title").val();var c=a("#edit-menu-item-url").val();var h=a("#edit-menu-item-attr-title").val();var e=a("#edit-menu-item-target").val();var d=a("#edit-menu-item-description").val();var b=a("#edit-menu-item-classes").val();var f=a("#edit-menu-item-xfn").val();a(".menu #menu-item-"+i).find("span.item-title:first").html(g);a("#menu-item-"+i).children("input[name=menu-item-title[]]").val(g);a("#menu-item-"+i).children("input[name=menu-item-url[]]").val(c);a("#menu-item-"+i).children("input[name=menu-item-attr-title[]]").val(h);a("#menu-item-"+i).children("input[name=menu-item-target[]]").val(e);a("#menu-item-"+i).children("input[name=menu-item-description[]]").val(d);a("#menu-item-"+i).children("input[name=menu-item-classes[]]").val(b);a("#menu-item-"+i).children("input[name=menu-item-xfn[]]").val(f);a(".menu #menu-item-"+i+" dt:first").animate({backgroundColor:"#FFFF33"},{duration:"normal",complete:function(){a(this).css("backgroundColor","")}})},remove_menu_item:function(c){var b=a("#menu-item-"+c);if(b){a(b).find("dt").each(function(){a(this).animate({backgroundColor:"#FF3333"},{duration:"normal",complete:function(){a(this).parent().parent().remove()}})})}},add_to_menu:function(b,m,c,h,p,n,d,o,j,g,f,e,k){var l=a(".menu li").length+1;var i=wpNavMenu.get_hidden_inputs(l,b,m,c,h,n,d,o,j,g,f,e,k);a(".menu").append('<li id="menu-item-'+l+'" value="'+l+'"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="item-title">'+d+'</span><span class="item-controls"><span class="item-type">'+p+'</span><a class="item-edit thickbox" id="edit'+l+'" value="'+l+'" onclick="wpNavMenu.edit_menu_item('+l+');" title="'+navMenuL10n.thickbox+'" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">'+navMenuL10n.edit+'</a> | <a class="item-delete" id="delete'+l+'" value="'+l+'" onclick="wpNavMenu.remove_menu_item('+l+');">Delete</a></span></dt></dl>'+i+"</li>");a(".menu #menu-item-"+l+" dt:first").animate({backgroundColor:"#FFFF33"},{duration:"normal",complete:function(){a(this).css("backgroundColor","")}});wpNavMenu.drag_and_drop();tb_init("a.thickbox, area.thickbox, input.thickbox")},add_checked_items_to_menu:function(c){var b=a(c).parent().siblings(".list-wrap").find(":checked");if(0==b.length){return false}a(b).each(function(){var j=a(this).parent().siblings(".menu-item-type").val();if("custom"==j){var g=a(this).parent().siblings(".menu-item-attr-title").val();var h=a(this).parent().siblings(".menu-item-target").val();var i=a(this).parent().siblings(".menu-item-classes").val();var l=a(this).parent().siblings(".menu-item-xfn").val()}else{var g="";var h="";var i="";var l=""}var d=a(this).parent().siblings(".menu-item-db-id").val();var m=a(this).parent().siblings(".menu-item-object-id").val();var e=a(this).parent().siblings(".menu-item-object").val();var p=a(this).parent().siblings(".menu-item-append").val();var n=a(this).parent().siblings(".menu-item-parent-id").val();var f=a(this).parent().siblings(".menu-item-title").val();var o=a(this).parent().siblings(".menu-item-url").val();var k=a(this).parent().siblings(".menu-item-description").val();if(undefined==k){k=""}if(undefined==g){g=""}wpNavMenu.add_to_menu(d,m,e,j,p,n,f,o,k,g,h,i,l);a(this).attr("checked",false)})},get_hidden_inputs:function(l,b,m,c,h,n,d,o,j,g,f,e,k){var i="";i+='<input type="hidden" name="menu-item-db-id[]" value="'+b+'" />';i+='<input type="hidden" name="menu-item-object-id[]" value="'+m+'" />';i+='<input type="hidden" name="menu-item-object[]" value="'+c+'" />';i+='<input type="hidden" name="menu-item-type[]" value="'+h+'" />';i+='<input type="hidden" name="menu-item-parent-id[]" value="'+n+'" />';i+='<input type="hidden" name="menu-item-position[]" value="'+l+'" />';i+='<input type="hidden" name="menu-item-title[]" value="'+d+'" />';i+='<input type="hidden" name="menu-item-attr-title[]" value="'+g+'" />';i+='<input type="hidden" name="menu-item-url[]" value="'+o+'" />';i+='<input type="hidden" name="menu-item-target[]" value="'+f+'" />';i+='<input type="hidden" name="menu-item-description[]" value="'+j+'" />';i+='<input type="hidden" name="menu-item-classes[]" value="'+e+'" />';i+='<input type="hidden" name="menu-item-xfn[]" value="'+k+'" />';return i}};a(document).ready(function(b){wpNavMenu.init()})})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminnavmenusphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/nav-menus.php (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-admin/nav-menus.php        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx">                                         $menu_item_url = isset( $_POST['menu-item-url'][$k] ) ? $_POST['menu-item-url'][$k] : '';
</span><span class="cx">                                         $menu_item_description = isset( $_POST['menu-item-description'][$k] ) ? $_POST['menu-item-description'][$k] : '';
</span><span class="cx">                                         $menu_item_attr_title = isset( $_POST['menu-item-attr-title'][$k] ) ? $_POST['menu-item-attr-title'][$k] : '';
</span><del>-                                        $menu_item_target = isset( $_POST['menu-item-target'][$k] ) ? $_POST['menu-item-target'][$k] : '_self';
</del><ins>+                                        $menu_item_target = isset( $_POST['menu-item-target'][$k] ) ? $_POST['menu-item-target'][$k] : '';
</ins><span class="cx">                                         $menu_item_classes = isset( $_POST['menu-item-classes'][$k] ) ? $_POST['menu-item-classes'][$k] : '';
</span><span class="cx">                                         $menu_item_xfn = isset( $_POST['menu-item-xfn'][$k] ) ? $_POST['menu-item-xfn'][$k] : '';
</span><span class="cx">
</span><span class="lines">@@ -314,7 +314,7 @@
</span><span class="cx">                 <label for="edit-menu-item-target">
</span><span class="cx">                         <?php _e( 'Link Target' ); ?><br />
</span><span class="cx">                         <select id="edit-menu-item-target" class="widefat" name="edit-menu-item-target" tabindex="4">
</span><del>-                                <option value="_self"><?php _e('Same window or tab'); ?></option>
</del><ins>+                                <option value=""><?php _e('Same window or tab'); ?></option>
</ins><span class="cx">                                 <option value="_blank"><?php _e('New window or tab'); ?></option>
</span><span class="cx">                         </select>
</span><span class="cx">                 </label>
</span></span></pre></div>
<a id="trunkwpincludesclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/classes.php (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/classes.php        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-includes/classes.php        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -1196,7 +1196,7 @@
</span><span class="cx">
</span><span class="cx">                         // @todo add classes for parent/child relationships
</span><span class="cx">
</span><del>-                        $css_class = join( ' ', apply_filters('nav_menu_css_class', $css_class, $item) );
</del><ins>+                        $css_class = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $css_class ), $item ) );
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 $maybe_value = ( 'backend' == $args->context ) ? ' value="'. $item->ID .'"' : '';
</span></span></pre></div>
<a id="trunkwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu-template.php (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu-template.php        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-includes/nav-menu-template.php        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -154,10 +154,10 @@
</span><span class="cx">         $output = '';
</span><span class="cx">         switch ( $context ) {
</span><span class="cx">                 case 'frontend':
</span><del>-                        $attributes = ( isset($menu_item->attr_title) && '' != $menu_item->attr_title ) ? ' title="'. esc_attr($menu_item->attr_title) .'"' : '';
-                        $attributes .= ( isset($menu_item->target) && '' != $menu_item->target ) ? ' target="'. esc_attr($menu_item->target) .'"' : '';
-                        $attributes .= ( isset($menu_item->xfn) && '' != $menu_item->xfn ) ? ' rel="'. esc_attr($menu_item->xfn) .'"' : '';
-                        $attributes .= ( isset($menu_item->url) && '' != $menu_item->url ) ? ' href="'. esc_attr($menu_item->url) .'"' : '';
</del><ins>+                        $attributes = ! empty( $menu_item->attr_title ) ? ' title="' . esc_attr( $menu_item->attr_title ) .'"' : '';
+                        $attributes .= ! empty( $menu_item->target ) ? ' target="' . esc_attr( $menu_item->target ) .'"' : '';
+                        $attributes .= ! empty( $menu_item->xfn ) ? ' rel="' . esc_attr( $menu_item->xfn ) .'"' : '';
+                        $attributes .= ! empty( $menu_item->url ) ? ' href="' . esc_attr( $menu_item->url ) .'"' : '';
</ins><span class="cx">
</span><span class="cx">                         $output .= esc_html( $args->before );
</span><span class="cx">                         $output .= '<a'. $attributes .'>';
</span></span></pre></div>
<a id="trunkwpincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu.php (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu.php        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-includes/nav-menu.php        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -250,7 +250,7 @@
</span><span class="cx">
</span><span class="cx">                         $menu_item->title = $menu_item->post_title;
</span><span class="cx">                         $menu_item->url = get_permalink( $menu_item->ID );
</span><del>-                        $menu_item->target = '_self';
</del><ins>+                        $menu_item->target = '';
</ins><span class="cx">
</span><span class="cx">                         $menu_item->attr_title = '';
</span><span class="cx">                         $menu_item->description = strip_tags( $menu_item->post_content );
</span><span class="lines">@@ -271,7 +271,7 @@
</span><span class="cx">
</span><span class="cx">                         $menu_item->title = $menu_item->name;
</span><span class="cx">                         $menu_item->url = get_term_link( $menu_item, $menu_item_object );
</span><del>-                        $menu_item->target = '_self';
</del><ins>+                        $menu_item->target = '';
</ins><span class="cx">                         $menu_item->attr_title = '';
</span><span class="cx">                         $menu_item->description = strip_tags( $menu_item->description );
</span><span class="cx">                         $menu_item->classes = '';
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-includes/script-loader.php        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -399,7 +399,7 @@
</span><span class="cx">                 ) );
</span><span class="cx">
</span><span class="cx">                 // Custom Navigation
</span><del>-                $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100322b' );
</del><ins>+                $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100403' );
</ins><span class="cx">                 $scripts->localize( 'nav-menu', 'navMenuL10n', array(
</span><span class="cx">                         'custom' => _x('Custom', 'menu nav item type'),
</span><span class="cx">                         'thickbox' => _x('Edit Menu Item', 'Thickbox Title'),
</span></span></pre></div>
<a id="trunkwpincludesversionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/version.php (13973 => 13974)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2010-04-03 21:47:32 UTC (rev 13973)
+++ trunk/wp-includes/version.php        2010-04-03 22:52:30 UTC (rev 13974)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @global int $wp_db_version
</span><span class="cx"> */
</span><del>-$wp_db_version = 13956;
</del><ins>+$wp_db_version = 13974;
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Holds the TinyMCE version
</span></span></pre>
</div>
</div>
</body>
</html>