WPML不适用于自定义add_rewrite_rule,当我尝试使用?lang = ar 时,它将返回404错误
但是它正在与其他网址一起使用
WPML网址设置Formate =>?lang = ar
http://example.com/page_slug/category/radio/。 ==>工作正常 http://example.com/page_slug/category/radio/?lang=ar ==>不起作用
其他URL formate运行正常 http://example.com/ar/page_slug/category/radio/ ==>工作正常 http://ar.example.com/page_slug/category/radio/ ==>工作正常
我的代码:
$page_id = 2;
$link = get_permalink($page_id);
add_rewrite_rule( "$link/category/([^/]+)/?$", 'index.php?page_id=' . $id . '&rtcl_category=$matches[1]', 'top' );
WPML网址设置Formate =>?lang = ar
http://example.com/page_slug/category/radio/。 ==>工作正常 http://example.com/page_slug/category/radio/?lang=ar ==>不起作用
其他URL formate运行正常 http://example.com/ar/page_slug/category/radio/ ==>工作正常 http://ar.example.com/page_slug/category/radio/ ==>工作正常
错误消息:找不到页面404错误