Ajax, menu switch not working
-
Hey,
Just updated to the latest version a few days ago and the menu is not switching anymore.
I’m using the latest version, 2 languages set, each has it’s own menu.
Here is a simple example I’ve made with Twenty Twelve theme:
PHP:
function test_load_menu_callback() { wp_nav_menu(array('container' => FALSE, 'theme_location' => 'primary')); die(); } add_action('wp_ajax_load_menu', 'test_load_menu_callback'); add_action('wp_ajax_nopriv_load_menu', 'test_load_menu_callback');JS:
jQuery(document).ready(function($){ $('body').on('click', 'a', function(e){ e.preventDefault(); var data = { action: 'load_menu', pll_load_front: true }; $.ajax({ type: 'POST', url: ajax_object.ajax_url, data: data, cache: false, dataType: 'json', }).done(function(response){ console.log(response); }); }); });In the version 1.0.4 the result was that the menu was switched to the other language. In the current version, running the same code the result is the same menu as it is, meaning that it does not switch the language.
What to do?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Ajax, menu switch not working’ is closed to new replies.