0

How can i disable /wp-admin/customize.php redirect to login page when accessed directly?

I want to use customize.php if user logged in as admin, but when user is not logged in i want to disable the redirect to the login page.

0

to redirect all admin pages to home page when the user is not connected, try that

add_filter("login_url", function ($login_url, $redirect, $force_reauth) {

    if (!is_user_logged_in()) {
        $login_url = home_url("/");
    }


    return $login_url;

}, 10, 3);

If you want to redirect only on the page "customize.php", you can add the condition at the "if".

  • not working for me. – X11 Nov 25 '17 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.