What do you mean by "popup"? There are many ways to restrict content, but like anything else, how to do it depends on your intentions.
Hey Victor,
Thanks for the response.
I currently display job applications via a view but would like to restrict the views to only display once the login field has been utilized https://i.imgur.com/bS24RS1.png
You can do that by adjusting the page visibility settings in wordpress or via a view parameter with a parameter of default = none.
[get param=entry default="none"]
Here is a quick snippit you could use if you don't need anything fancy, add it to Code Snippets Plugin. You use the shortcode
[check-user-role role="subscriber"] your content or view shortcode [/check-user-role]
You can change the role= to whatever your roles are.
<script>
function func_check_user_role( $atts, $content = null ) { $user = wp_get_current_user(); $user_role = $atts['role']; $allowed_roles = []; array_push($allowed_roles , $user_role); if ( is_user_logged_in() && array_intersect($allowed_roles, $user->roles ) ) { return $content; } else { return ''; } } add_shortcode( 'check-user-role', 'func_check_user_role' );</script>
Please login or Register to submit your answer