Skip to content

redirect anonymous user to login page

Home Forums Pre-Sale Questions redirect anonymous user to login page

This topic contains 1 reply, has 2 voices, and was last updated by 4 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24424 Resolve | Reply

    Hi!

    I would like to do these two things:

    1. When an anonymous user tries to access a page which is blocked for anonymous users, you get a 404 page, but can it also be a redirect to the wp-admin login page?

    2. Is it possible to check if a page is restricted for the current users role, so I can add an icon behind the menu item to indicate they need to login on accessing the page?

    With kind regards,

    Laurens

    #24596 Reply

    These functionalities are not provided as precooked options, but can be achieved with a little supplemental code:

    1) Redirect to login if 404 is actually for unauthorized page access:

    2) Check whether a representative user can read a page:

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Registered members have full access to Pro support forums here.

Feel free to log in or purchase a support key.