Ajax + qtranslate

戏子无情 提交于 2019-12-07 14:04:57

问题


Hi I ran into the same problem as Rik had here

The answer given was that he had to "Search in code for link request "ajax.php". Replace "ajax.php" with ajax.php/?lang='.qtrans_getLanguage()" "

My question is this (I know it might sound stupid, I suck at this stuff), what code does this answer refer to and where do I find it? I've searched all php files in the qtranslate and ajax plugins but cannot find where it is.


回答1:


It depends on which WP ajax-plugin you have a problem with. In case "Category-Post AJAX Tree" I had to replace

$localize = array ('ajaxurl' => admin_url('admin-ajax.php'),

with

$localize = array ('ajaxurl' => admin_url('admin-ajax.php?lang='.qtrans_getLanguage()),

in cat-post-tree-ajax.php and to replace

var url = CatPostAjax.ajaxurl + '?action=myajax-submit&category=' + id; // compose url

with

var url = CatPostAjax.ajaxurl + '&action=myajax-submit&category=' + id; // compose url

in cat-post-tree-ajax.js. Please tell us what plugin you mean so we'll be able to help.



来源:https://stackoverflow.com/questions/7800630/ajax-qtranslate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!