Access is a WordPress plugin that lets you add custom roles and control their privileges.
Access User Guides include detailed documentation for controlling what actions different roles and users can do on content and what WordPress admin screens users can access.
When you ask for help or report issues, make sure to tell us the versions of the Toolset plugins that you have installed and activated.
Viewing 15 topics - 496 through 510 (of 911 total)
Problem: I have created a Form to edit a post, and I would like to display the Edit Post Form link to only site admins and to the post author. Other site visitors should not see this link.
Solution: Use a combination of Access Control shortcodes and conditional HTML to handle the conditional display of this link.
[wpv-conditional if="( [wpv-post-author format='meta' meta='id'] eq [wpv-current-user format='meta' info='id'] )"]
Current User is post author. [toolset-edit-post-link layout_slug='program-edit-layout' target='self']Edit %%POST_TITLE%%[/toolset-edit-post-link]
[/wpv-conditional]
[toolset_access role="Administrator" operator="allow"]
[wpv-conditional if="( [wpv-post-author format='meta' meta='id'] ne [wpv-current-user format='meta' info='id'] )"]
Current User is admin but not author: [toolset-edit-post-link layout_slug='program-edit-layout' target='self']Edit %%POST_TITLE%%[/toolset-edit-post-link]
[/wpv-conditional]
[/toolset_access]
Problem: I would like to know how best to conditionally show or hide certain sections of a Form based on User role.
Solution: Access Control shortcodes should work well to hide content conditionally based on User role. Otherwise, conditional HTML can be used. The preferred shortcode now is wpv-conditional instead of wpv-if.
I used the custom PHP code below to redirect on the user logging in, But it is not being picked up as access control is activating when going to a specific page: