How to allow subscribers to create post of a new custom post type
How to allow subscribers to create post of a new custom post type
How to allow subscribers to create post of a new custom post type
Only those that are authors have an author page. This is not true. Thing is, that user being ‘Subscriber’ means it doesnt have a page. Neither is this. Is there a capability that I can give that would give the user an author page? I can’t seem to find what would trigger that. You can’t … Read more
coauthors_plus_edit_authors to display metabox based on author caps
How to create a WP Capability that limits editing to posts in a certain category?
I found another piece of code on the internet which I have modified to work. add_filter(‘the_comments’, ‘edit_comments_filter_comments’); function edit_comments_filter_comments($comments){ global $pagenow; $currentuserid = get_current_user_id(); if($pagenow == ‘edit-comments.php’ && !current_user_can(‘edit_others_posts’)){ foreach($comments as $i => $comment){ $the_post = get_post($comment->comment_post_ID); if($comment->user_id != $currentuserid && $the_post->post_author != $currentuserid) unset($comments[$i]); } } return $comments; } As I understand it, this … Read more
Restrict APP REST API for users with account and capabilities
Here’s how I’d handle it (mostly you’re right, and the tweak in your answer to use init gets you closer, but — as you’ve discovered — doing a bunch of switch_to_blog() / restore_current_blog() calls on every single page load is costly). function add_opportunities_capability_to_admins() { // Set up the needed capabilities. $capabilities = array( ‘edit_opportunity’, ‘read_opportunity’, … Read more
In Multisite, Core only allows super admins to edit CSS by default. One of the reasons is that there are some security edge cases, especially in older browsers. To allow site admins, you’ll need to grant them the edit_css capability. It sounds like you tried to do that with your plugin, but without seeing the … Read more
Try: function allow_daniel_edit( $caps = array(), $cap = ”, $user_id = 0, $args = array() ) { if ($user_id == 59) { return array( ‘bp_moderate’ ); // or some other permission or additional permissions } return $caps; } add_filter( ‘map_meta_cap’, ‘allow_daniel_edit’, 999, 4 );
When the submenu is registered: add_submenu_page( ‘woocommerce’, __( ‘Betalingsmetoder’, ‘wcrb’ ), __( ‘Betalingsmetoder’, ‘wcrb’ ), ‘manage_options’, ‘payment-gateway-report’, ‘wcrb_report_page_callback’ ); You’ve specified that you only want it to be shown to users with the capability manage_options. So only administrators have that capability, so only administrators can see that page. It’s documented in the official WP docs … Read more