Is it possible to restrict all admin pages except theme customisation and storefront using plugin?

I want to restrict all admin pages except theme customise. I am wp_set_auth_cookie() for auto login. I don't need a

I want to restrict all admin pages except theme customise. I am wp_set_auth_cookie() for auto login. I don't need any other admin pages.

I write code in my plugin

add_action( 'wp_loaded', 'my_theme_customization' );

function my_theme_customization()
{
    global $pagenow;
    if ($pagenow !== 'customize.php' && is_admin()) {
        header('Location:' . site_url());
        exit;
    }
}

But I am not able publish with what I changed. Is there any other way to do this? Thanks in advance

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745155333a4614085.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信