Wordpress admin-ajax and user profile localization -
so i've got english-language theme localized spanish. works fine in spanish.
but if change user profile language english - can see english on dashboard - ajax-generated content on site becomes untranslated english.
if log out, ajax-generated content becomes spanish again.
my guess here admin-ajax loading user profile language instead of theme language, if user profile language set.
so question is: how can correct this, admin-ajax uses theme language?
edit: here's ajax call. i'm not sending text translated.
$('#load_more').on('click', function() { var offset = $('#main-ajax-container').data('offset'); var prefix = $('#main-ajax-container').data('prefix'); var blogid = $('#main-ajax-container').data('blogid'); var fid = $('#main-ajax-container').data('fid'); $.ajax({ type: "get", url: "wp-admin/admin-ajax.php", data: { action: "home_load_more", siteurl: "<?php echo get_site_url();?>", offset: offset, prefix: prefix, blogid: blogid, fid: fid }, success: function(resp) { $('#main-ajax-container').append(resp); offset = parseint(offset) + 3; $('#main-ajax-container').data('offset', offset); var max = $('#main-ajax-container').data('max'); if (offset >= parseint(max)) { $('#load_more').addclass('done'); } } }); });
Comments
Post a Comment