Author capabilities: Deleting comments on their own published posts
You can add the capability by using add_cap. But as far as I know there is no way to do this only for their posts, so it would be for all posts.
You can add the capability by using add_cap. But as far as I know there is no way to do this only for their posts, so it would be for all posts.
This filter needs to return something. Try this function modify_contact_methods($profile_fields) { if(current_user_can(‘edit_users’)) { // Field addition and removal will be done here // Add new fields $profile_fields[‘company_name’] = ‘Company Name’; $profile_fields[‘company_id’] = ‘Company ID’; } return $profile_fields; } add_filter(‘user_contactmethods’, ‘modify_contact_methods’);
You should be able to do this via the option_page_capability_{$option_page} hook – like: function wpse151616_grant_access_to_options_page_for editors() { return ‘edit_posts’; } add_filter( ‘option_page_capability_rooster’, ‘wpse151616_grant_access_to_options_page_for editors’ ); For possible return values take a look at Roles and Capabilities. The variable part – {$option_page} – of the hook name is substituted by the menu slug – $menu_slug – … Read more
Is it possible to restrict a specific user to edit a specific custom post.
you could try some thing like this. add_action( ‘register_form’, ‘my_register_form’ ); function my_register_form() { ?> <select> <option>Role_1</option> <option>Role_2</option> <option>Role_3</option> </select> <?php }
Users can only save their draft once before saving for revision
Manually change 1 user to a contributor then view their wp_capabilities entry in wp_usermeta table. Update the rest of the table to set wp_capabilities to this value for the 12,000 users.
Have you considered using the get_the_author_meta() function? It would look something like this: if (get_the_author_meta(‘ID’) == ID_YOU_ARE_TESTING_FOR) { // display text } This would need to be used within the Loop.
User roles and associated capabilities are all stored in the $prefix_options table in the $prefix_user_roles (note that in both of these $prefix is a variable, so if your $prefix is foo_, your table will be foo_options). You need to sync this value between databases. As far as I’m aware, there is not a way to … Read more
Allow users to change author of post