Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3307
    dweb360
    Participant

    Hello,
    I have a shop administrator user role, how to diseable admin menu link to Jetpack for this role ?
    Thank you

    #3308
    Vladimir
    Keymaster

    Hi,

    1) Do not grant ‘manage_options’ capability

    2) Try to use this code at functions.php or as a Must Use plugin:

    
    add_filter( 'map_meta_cap', 'my_jetpack_custom_caps', 10, 4 );
    
    function my_jetpack_custom_caps($caps, $cap, $user_id, $args) {
        switch( $cap ) {
            case 'jetpack_admin_page':
            case 'jetpack_connect_user':
                $caps = array( 'manage_options' );
        }
        
        return $caps;
    }
    

    It will replace ‘read’ capability (used at Jetpack by default) with ‘manage_options’.

    #3309
    dweb360
    Participant

    Very good
    Fixed as usual

    Thank you

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.