Remove AYS for deleting a menu item. fixes #13330.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
966841f103
commit
337df6e337
|
@ -692,29 +692,24 @@ var wpNavMenu;
|
||||||
matchedSection,
|
matchedSection,
|
||||||
that = this;
|
that = this;
|
||||||
|
|
||||||
// Delete warning AYS
|
matchedSection = /_wpnonce=([a-zA-Z0-9]*)$/.exec(clickedEl.href);
|
||||||
if ( confirm( navMenuL10n.warnDeleteMenuItem ) ) {
|
if ( matchedSection && matchedSection[1] ) {
|
||||||
matchedSection = /_wpnonce=([a-zA-Z0-9]*)$/.exec(clickedEl.href);
|
itemID = parseInt(clickedEl.id.replace('delete-', ''), 10);
|
||||||
if ( matchedSection && matchedSection[1] ) {
|
$.post(
|
||||||
itemID = parseInt(clickedEl.id.replace('delete-', ''), 10);
|
ajaxurl,
|
||||||
$.post(
|
{
|
||||||
ajaxurl,
|
action:'delete-menu-item',
|
||||||
{
|
'menu-item':itemID,
|
||||||
action:'delete-menu-item',
|
'_wpnonce':matchedSection[1]
|
||||||
'menu-item':itemID,
|
},
|
||||||
'_wpnonce':matchedSection[1]
|
function (resp) {
|
||||||
},
|
if ( '1' == resp )
|
||||||
function (resp) {
|
that.removeMenuItem(document.getElementById('menu-item-' + itemID));
|
||||||
if ( '1' == resp )
|
}
|
||||||
that.removeMenuItem(document.getElementById('menu-item-' + itemID));
|
);
|
||||||
}
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -384,7 +384,7 @@ function wp_default_scripts( &$scripts ) {
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// Custom Navigation
|
// Custom Navigation
|
||||||
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100519' );
|
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100520' );
|
||||||
$scripts->localize( 'nav-menu', 'navMenuL10n', array(
|
$scripts->localize( 'nav-menu', 'navMenuL10n', array(
|
||||||
'home' => _x('Home', 'nav menu home label'),
|
'home' => _x('Home', 'nav menu home label'),
|
||||||
'homeurl' => home_url('/'),
|
'homeurl' => home_url('/'),
|
||||||
|
@ -393,7 +393,6 @@ function wp_default_scripts( &$scripts ) {
|
||||||
'edit' => _x('Edit', 'menu item edit text'),
|
'edit' => _x('Edit', 'menu item edit text'),
|
||||||
'noResultsFound' => _x('No results found.', 'search results'),
|
'noResultsFound' => _x('No results found.', 'search results'),
|
||||||
'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
|
'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
|
||||||
'warnDeleteMenuItem' => __( "You are about to permanently delete this menu item. \n 'Cancel' to stop, 'OK' to delete." ),
|
|
||||||
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
|
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue