I'm displaying a form to let users edit a custom post type.
The users have the role "Suscriber". In this custom post type I created a specific field linked to WordPress users to specify who was able to see the form.
It was working fine but I think since last update now these suscribers users see : "You are not allowed to edit this post."
Is there a way to let them edit the post anyway ?
We added the check for permission in the latest version of MB Frontend Submission. Users can edit posts only if:
If you allows a user to edit others' posts, they must have
edit_other_posts privilege, which is available for Editor role.
OK thanks for your quick answer Anh, I added the permission with Members plugin.
Maybe it would be great to add an option in the shortcode to specify who can access the form.
Hi, it seems this isn't so straightforward. I added the
edit_other_posts but this actually doesn't exist. WP documents
Either way, both privilege types don't work. The users are still not allowed to edit the post. Must the privileges be flushed somehow?
These are the permissions that the user group has:
add_role( 'analyst', __('Analyst' ), array( 'read' => true, // true allows this capability 'edit_posts' => true, // Allows user to edit their own posts 'edit_pages' => false, // Allows user to edit pages 'edit_other_posts' => true, 'edit_others_posts' => true, // Allows user to edit others posts not just their own 'create_posts' => false, // Allows user to create new posts 'manage_categories' => false, // Allows user to manage post categories 'publish_posts' => true, // Allows the user to publish, otherwise posts stays in draft mode 'edit_themes' => false, // false denies this capability. User can’t edit your theme 'install_plugins' => false, // User cant add new plugins 'update_plugin' => false, // User can’t update any plugins 'update_core' => false, 'upload_files' => true // user cant perform core updates ) );
Hi boethius, you're right about the capability name. It should be
The plugin checks if user can edit the current post with this code:
current_user_can( 'edit_post', $post->ID )
Can you please try a plugin like Members/User Roles Editor to make sure that roles can edit posts?