• Resolved Marc Wiest

    (@marclarr)


    Hi, I’d like to give my Contributor user role access to the the “upload_files” capability, it’s the “Add Media” button above TinyMCE on the post screen, but still keeping the “Add Content Block” hidden.

    $role_object = get_role( 'contributor' );
    $role_object->add_cap( 'upload_files' );
    // $role_object->remove_cap( ? );

    Is there a capability for said button? Or how would I do that?
    Thanks much!

    http://wordpress.org/plugins/custom-post-widget/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Marc Wiest

    (@marclarr)

    I also just tried:

    remove_action( 'admin_head', 'check_post_type_and_remove_media_buttons' );

    and

    remove_filter( 'media_buttons', 'add_content_block_icon' );

    But still no success.

    Plugin Author Johan van der Wijk

    (@vanderwijk)

    This should do the trick (note that the action remove action is fired on ‘init’):

    // Remove content block button
    function remove_add_content_block_button() {
    	 remove_action( 'admin_head','check_post_type_and_remove_media_buttons' );
    }
    add_action('init','remove_add_content_block_button');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User Role & Capability for "upload_files"’ is closed to new replies.