Fix nav menu locations sorting. props jorbin, koopersmith with assists. see #13378.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f268a16a8b
commit
49437c3491
|
@ -1107,7 +1107,7 @@ case 'menu-locations-save':
|
||||||
if ( ! current_user_can( 'edit_theme_options' ) )
|
if ( ! current_user_can( 'edit_theme_options' ) )
|
||||||
die('-1');
|
die('-1');
|
||||||
check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );
|
check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );
|
||||||
if ( ! isset( $_POST['menu-locations' ] ) )
|
if ( ! isset( $_POST['menu-locations'] ) )
|
||||||
die('0');
|
die('0');
|
||||||
set_theme_mod( 'nav_menu_locations', $_POST['menu-locations'] );
|
set_theme_mod( 'nav_menu_locations', $_POST['menu-locations'] );
|
||||||
die('1');
|
die('1');
|
||||||
|
|
|
@ -357,13 +357,13 @@ var wpNavMenu;
|
||||||
},
|
},
|
||||||
|
|
||||||
attachThemeLocationsListeners : function() {
|
attachThemeLocationsListeners : function() {
|
||||||
var loc = $('#nav-menu-theme-locations'),
|
var loc = $('#nav-menu-theme-locations'), params = {};
|
||||||
params = {
|
params['action'] = 'menu-locations-save';
|
||||||
'action': 'menu-locations-save',
|
params['menu-settings-column-nonce'] = $('#menu-settings-column-nonce').val();
|
||||||
'menu-locations': loc.find('select').serialize(),
|
|
||||||
'menu-settings-column-nonce': $('#menu-settings-column-nonce').val()
|
|
||||||
};
|
|
||||||
loc.find('input[type=submit]').click(function() {
|
loc.find('input[type=submit]').click(function() {
|
||||||
|
loc.find('select').each(function() {
|
||||||
|
params[this.name] = $(this).val();
|
||||||
|
});
|
||||||
loc.find('.waiting').show();
|
loc.find('.waiting').show();
|
||||||
$.post( ajaxurl, params, function(r) {
|
$.post( ajaxurl, params, function(r) {
|
||||||
loc.find('.waiting').hide();
|
loc.find('.waiting').hide();
|
||||||
|
|
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, '20100520' );
|
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100520a' );
|
||||||
$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('/'),
|
||||||
|
|
Loading…
Reference in New Issue