admin管理员组

文章数量:1414900

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

本文标签: Is it possible to restrict all admin pages except theme customisation and storefront using plugin