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.
Viewing 15 topics - 226 through 240 (of 250 total)
Problem: My Users View shows "no results found" when sorting by a custom field.
Solution: WordPress has a quirk when sorting by a custom field. If the User (or post or term) does not have a value for that custom field, it will not be part of the results.
1) Edit the page "Registrazione NCC", section "Post Group", choose option as :
No Post Group selected.
2) Dashboard-> Toolset-> Access Control-> CRED form
in section "CRED Users Frontend Access",
find "Create Custom User with CRED Form "Registrazione NCC"", enable option for guest user.
Problem:
What are the options for displaying different content to different users on the front-end?
Solution:
To display different content on the front-end according to some criteria you essentially have two options.
If the thing being tested relates to the person doing the looking (the user browsing the website is registered and has a certain role because they have paid for a particular membership, for example) then you can use Access to restrict the visibility of whole pages, or to selectively show certain content on a page (as described here: https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/).
If the thing being tested relates to the thing being looked at then you would need to add custom fields to the content being viewed and then use the wpv-conditional shortcodes to test the content of those custom fields and selectively display what is wrapped in the shortcode, as described here: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
Problem: I would like to manage Access settings for the Yoast SEO plugin.
Solution: Go to Change Permissions and click Other capabilities. You will find these options in the "Other capabilities" section, near the bottom. There is no section specific for Yoast permissions.
Problem: I would like to add a registration form that allows people to claim ownership of a post. Once an admin approves their ownership, the registrant becomes author of that post.
Solution:
If I were trying to do something like this, I would follow this process:
- Create a new CPT called Pending Approvals
- Add custom fields to the Pending Approval CPT - user ID, university ID, college ID, and school ID
- Use cred_save_data to create a Pending Approval post whenever someone submits the User Registration form while trying to claim ownership of a University, College or School.
- Save the new User's ID and the appropriate University, College or School ID in the Pending Approval post
- Create a View of Pending Approval posts. In the Loop of results, include a "Delete Post" link that can be used to decline the ownership request. Also include an Edit CRED form that edits the University, College, or School. Hide or remove all the visible inputs from this form except the submit button, and give it a name like "Approve Ownership"
- Use the cred_save_data hook to update the University, College, or School post author when this form is submitted, and trash the Pending Approval post.
- Insert the View of Pending Approval posts in a page that is restricted to site administrators.
Problem:
How to enable certain users to be able to translate particular posts or pages.
Solution:
This is a feature of WPML.
If you go to WPML > Translation Management > Multilingual Content Setup, the first option is to either create translations manually (using the standard WP post editor) or to use the WPML translation editor.
If you have chosen the latter, then you MUST create translators and specify the languages they can translate etc.
If you have chosen to edit manually, Access needs to manage pages, and the role in question needs to be able to publish and edit own pages.
Problem: I would like to programmatically change the post status of all posts by the current User in a PHP hook I have set up to handle User role changes.
Solution: You can use the WordPress get_posts function to query all the author's posts, then update each of the posts as needed with wp_update_post. Here is a basic example:
...
$user->set_role( 'tsn_bronze' );
// get all the published Voyage posts by the current user
$args = array(
'post_type' => 'voyage',
'post_status' => 'publish',
'author' => $user_id,
'posts_per_page' => -1);
$posts_array = get_posts($args);
// loop over those posts and update each one to status "pending"
foreach ($posts_array as $the_post) {
$update_post = array(
'ID' => $the_post->ID,
'post_status' => 'pending'
);
wp_update_post( $update_post );
}
If you want to use the same code to update posts of more than one custom post type, modify the 'post_type' argument to use an array instead of a single string: