Remove view shipment column in shipment table by roles

Note: Please copy and paste this code in functions.php of your current theme.

  function remove_view_shipment_callback(){
    $current_user = wp_get_current_user();
    /*
    * WPCargo Roles
    */

    /* 
    * wpcargo_client
    * wpcargo_pending_client
    * wpcargo_employee
    * cargo_agent
    */

    // Remove View Shipment Column from the shipment table
    if( in_array( "wpcargo_client", $current_user->roles ) ){
      remove_action( 'wpcfe_shipment_table_header', 'wpcfe_shipment_table_header_view', 25 );
      remove_action( 'wpcfe_shipment_table_data','wpcfe_shipment_table_data_view', 25 );
    }
      
  }
  add_action( 'init', 'remove_view_shipment_callback' );
  
2
    2
    Your Cart
    Remove
    WPCargo Shipment Rate
    1 X $79.00 = $79.00
    Remove
    WPCargo Advance Package
    2 X $349.00 = $698.00