Access plugin lets you control what sections different user roles can reach in the WordPress admin and on the front-end. You can create your own custom roles and choose exactly what administration capabilities they have on the site.
When you ask for help or report issues, make sure to tell us the roles that you want to create and the desired capabilities of these roles.
Problem: I have created a custom role with Access. I would like to choose a User in that custom role, when selecting the author of a post. It turns out that none of the Users in this custom role appear in the author dropdown options. What should I do to add and enable those author select options?
Solution: Please add a custom code snippet to your site in order to add these Users to the select author dropdown field:
function wpdocs_add_members_to_dropdown( $query_args, $r ) {
$query_args['role'] = array('member');
// Unset the 'who' as this defaults to the 'author' role
unset( $query_args['who'] );
return $query_args;
}
add_filter( 'wp_dropdown_users_args', 'wpdocs_add_members_to_dropdown', 10, 2 );
Problem: The "edit post link" is not appearing for certain roles despite having Form controls set appropriately in Toolset Access Control.
Solution: Check the post type access control settings to ensure Access is managing this post type. If not, activate Access control for this post type and set the controls appropriately.
Problem: I would like to create a conditional that tests whether or not the current logged-in User has a specific capability.
Solution: Use the built-in WordPress function current_user_can to check for any individual capability. You must register current_user_can in Toolset > Settings > Front-end Content > Functions inside conditional evaluations, then you can do something like this:
[wpv-conditional if="(current_user_can('access_s2member_ccap_4792') eq 1)"]
current user has capability access_s2member_ccap_4792
[/wpv-conditional]
[wpv-conditional if="(current_user_can('access_s2member_ccap_4792') ne 1)"]
current user does not have capability access_s2member_ccap_4792
[/wpv-conditional]
Problem: I would like to incorporate conditionals based on User roles, along with other factors like custom field values.
Solution: For simplicity, it's best to use Access Control shortcodes first to separate Users by role. Then within those Access Control shortcodes, implement your various other conditional to determine what content should be shown. This will lead to some duplication of code, but in exchange the code is more manageable.