How To Remove Add Parcel From WPCargo Client User Role

Code goes on your active theme’s functions.php file:


function wpc_custom_remove_sidebar_menu_callback(){
    // get current user data and roles
    $current_user = wp_get_current_user();
    $user_roles = $current_user->roles;


    // if role is wpcargo_client, remove "Add Parcel" menu
    if(in_array('wpcargo_client', $user_roles)){
        remove_action( 'wpcfe_after_add_shipment', 'wpcsr_menu_items_callback' );
    }
}
add_action('init', 'wpc_custom_remove_sidebar_menu_callback');

0
    0
    Your Cart
    Your cart is emptyReturn to Shop