我开发了一个 wordpress 插件。在我的插件中,我通过获取参数来管理所有页面,(http://example.com/client-portal/?page=dashboard)
并且它一直工作到 wordpress 5.4 版
但是新版 wordpress 5.5 版中会自动重定向http://example.com/client-portal/?page=dashboard
到http://example.com/client-portal/
. 获取参数自动消失。
我通过这种方式添加了简码 -
//page short code for user page
add_shortcode( 'ccgclient_portal', array($this,'ccgclient_portal_shortcode_func') );
这是我的简码功能 -
function ccgclient_portal_shortcode_func()
{
ob_start();
include_once 'pages/user/index.php';
return ob_get_clean();
}
并通过 - 捕获获取参数
if(isset($_GET['page']) && $_GET['page'] == 'dashboard'){
include_once 'dashboard.php';
}
不知道新版wordpress(5.5)有什么问题。
请问你能帮我吗?
提前致谢。