what are the simple hooks, filters, process to restrict page access
-
hello,
Without using a plugin, looking to only do the following:
0) a public page does not check for users.
1) make a page force a user to be logged in (ie. a restricted access page)
2) if a visitor goes to this page, wordpress redirects them to the custom login page
3) allow admin to view any page (if they are logged in)currently using:
add_filter( ‘login_redirect’, ‘my_login_redirect’, 10, 3 );and then putting PHP code on pages where it checks the visitor or user type (admin or just regular user).
All my variations in code either do not work, creates a login loop, or does not do all three requirements.
so I have 3 types of pages:
– all public
– Only user or admin
– only adminthis can’t be that hard, but I have not got it correct yet. Does anyone have a page that explains what I should be doing? The WP Core documentation takes me into many different directions… I get a little lost looking at it ??
thanks!
- The topic ‘what are the simple hooks, filters, process to restrict page access’ is closed to new replies.