Allowing user to edit posts based on the post status
Allowing user to edit posts based on the post status
Allowing user to edit posts based on the post status
After you’ve created the new role, you need to add the capability to it using add_cap. Check here for more info: https://codex.wordpress.org/Function_Reference/add_cap I think that for your particular case, you could replicate an Author but then remove certain capabilities using remove_cap https://codex.wordpress.org/Function_Reference/remove_cap
I cracked it! I went ahead and duplicated an existing role, and trimmed off all of the guff I didn’t think my sales role would need. In the end, I ended up with; assign_product_terms assign_shop_coupon_terms assign_shop_order_terms assign_shop_webhook_terms connections_view_public delete_others_products delete_others_shop_coupons delete_others_shop_orders delete_others_shop_webhooks delete_private_products delete_private_shop_coupons delete_private_shop_orders delete_private_shop_webhooks delete_product delete_product_terms delete_products delete_published_products delete_published_shop_coupons delete_published_shop_orders delete_published_shop_webhooks delete_shop_coupon delete_shop_coupon_terms … Read more
When you register a user keep 2 rule as select or radio button, And keep save the rule in the database. also, keep rule option in login, When the login checks the rule and give what access you want to give. For access keep a condition in top of each page like ‘if user rule … Read more
This appeared to be the result of (what I assume) was the User Role Editor plugin being updated, and then directly affecting the wp_user_role field on the options table of the database, which somehow led to DISALLOW_FILE_EDIT being ignored. I had to take several steps to fix this, as there were custom user roles I … Read more
How can I query users by custom role?
A much more efficient way that doesn’t require editing the source code: install and activate wpfront User role editor, go to all roles, edit the author role, scroll down to the ‘other capabilities’ section, check the following capabilities: wpProQuiz_show, wpProQuiz_add_quiz, wpProQuiz_edit_quiz Save. The authors on your site should now be able to add and edit … Read more
What we can do here is to create a meta box for each post, and assign a user to it. Then, on our post page, check whether the current user is related to the post or not. If they are not related to it, then redirect them back to homepage or somewhere else. I’m going … Read more
How can I allow an User to publish only 5 posts per month?
This will remove the option to change user group except if this is the administrator. The Codex states: While checking against particular roles in place of a capability is supported in part, this practice is discouraged as it may produce unreliable results. For this reason, I check for activate_plugins capability that normally only Admins will … Read more