How to filter the Print Options in shipment table
Note: Please copy and paste this code in functions.php of your current theme.
function custom_wpcfe_print_options_callback( $print_options ){ $current_user = wp_get_current_user(); /* * WPCargo Roles */ /* * wpcargo_client * wpcargo_pending_client * wpcargo_employee * cargo_agent */ // Remove Print Option in client role only if( in_array( "wpcargo_client", $current_user->roles ) ){ // Remove Invoice Print unset( $print_options["invoice"] ); // Remove Label Print unset( $print_options["label"] ); // Remove Waybill Print unset( $print_options["waybill"] ); } return $status; } add_filter( 'wpcfe_print_options', 'custom_wpcfe_print_options_callback' );