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 );
Related Posts:
- Why is javascript allowed in my post content?
- remove other tabs in new wordpress media gallery
- upload_files cap to not loggen in users – add_cap to not logged in users
- Insert HTML just after tag
- the_content and is_main_query
- How to Pass External Variables to Filters/Actions
- Filter by one custom field, order by another?
- Filter username field on registration for profanity and unwanted words
- At what priority does add_filter overwrite core functions?
- Add whitespace between Chinese and other letters
- How to add icons to post listing (edit.php) in admin
- Tiny MCE editor stripping xlink:href parameter from SVG USE tag
- Add quick edit fields without custom colum
- Prevent 404 when using pre_get_posts to filter an archive page
- Hook added to the_content seems to be called multiple times
- Keep Users Logged In As Long As I Like
- Is it possible to remove the filter from 4.8 text widget?
- Call to undefined function error after adding add_filter to wp-config
- How to remove X-Frame-Options: SAMEORIGIN” from WordPress?
- How can I hide all posts that don’t have a thumbnail?
- Filtering ‘the_title’ with option to return subhead?
- Restrict filter to run only inside specific function
- Setting title using wp_title filter
- 4.0 remove_filter for WordPress core function not working for me
- How do I add a current class to the current post?
- How apply_filters work in WordPress?
- Apply a filter only once
- Filtering admin entries for custom post type
- What hook/filter can I use to add/edit/show/hide the title under (on hover) links on the table view?
- option_active_plugins filter not working
- How do we check if the user is logging in or registering?
- Anonymous function is executed twice in wp_head while added from the_posts filter?
- add_filter return value
- Add a header before fields added with the attachment_fields_to_edit() filter
- Are there Limitations on filter handles?
- Why my admin doesn’t work after adding rest_prepare_post filter?
- How do I filter title and alt attributes in the gallery shortcode?
- remove_action in plugin file
- How to apply filter at search of woocommerce products?
- Variables in post title
- Filtering post-formats from the loop using new WP-Query();
- How to edit dashboard search posts button texts for my CPT?
- How to add a filter to get_the_author_meta?
- When does a function assigned to the content_filtered_edit_pre filter hook fire?
- Capture post content before page renders
- How can I remove the kses filters when saving a specific post type ? (it breaks my JSON)
- page_attributes_dropdown_pages_args filter does not work
- What different ways can a plugin add a filter to a WordPress site?
- Make an array filterable per hook
- How to pass variables to custom filter from multiple functions
- the_content filter together with require_once returns 1 instead of the content of the included file
- Missing Argument 2 for apply_filter
- Filter an array with a callback – for single & multidimensional arrays
- Detect when gutenberg editor title is available in Dom after editor load
- How to apply a filter to an ACF wysiwig editor field output?
- Are href attributes of a elements filtered on output to add the current path?
- Is it possible to bind a function to a filter hook via Ajax?
- Add a filter to an action [closed]
- Why template_include filter does not work with WPML plugin?
- Hide Posts In Back-end/Admin Based On User’s (Pseudo) Privileges Controlled by ACF
- Filter Pages by Custom Field (ACF) in admin area
- Most performant/functional way to add actions/filters?
- Remove tags without a specific meta key from “choose from the most used tags”
- Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?
- Making an add_filter() call from within an add_filter() call
- automatic title through filter
- Finding actual functions added to hooks and filters
- Buddypress Filter Multiple Activities [closed]
- How to apply filter on get_the_post_thumbnail()
- user_has_cap filter allows “edit_others_posts” but not is not allowing updating/publishing
- How do I check if I can use the allowed_block_types filter?
- Setting the page title in a plugin, but not outside my plugin
- oembed_dataparse filter not running at all for standard YouTube embed
- Security question – Display a General Custom Login Error Message
- Action for opening attachment or manipulating all attachment links
- Filter wp_mail based on content type
- Remove the post_content search from WHERE clause (and CONCAT sql function)
- mu-plugins body_class filter not working
- How to apply a filter to everything?
- WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page
- Conditionally (cpt) filter previous and next_post_link
- Post filter Month dropdown at front-end like wordpress backend
- shortcode function outputs multiple anchor tags
- changing size image within the content
- WP Dashboard -> Posts-> Filter by Category -> Form Method Change : Which Hook
- Show child theme for users on specific IP
- wp.getPosts with status = ‘trash’ using node.js
- Is there a way to overwrite a filter used in canonical.php?
- How do I remove certain HTML elements with specific classes from the feed?
- Adding an orderby filter, casting postmeta with multiple keys
- Sanitizing a custom query’s clauses
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- confusion with add_filter
- post->post_content filter
- How to change this WP logo and posts url in block editor?
- How to elect position of new item output in a dropdown when using add_filter
- Query Multiple Filters, one with Meta
- How to remove a filter that is an object method?
- Filter a custom post type by custom field in admin
- Using the REST API filter, including two meta_queries breaks the response for one custom post type