How to allow other user role to access Driver Report

By default only administrator role can access the Driver Report page in the dashboard, thank to filter hooks that was provided the plugin you can add additional roles to access.

Copy and paste this sample code to your theme function.php file.

Note: WPCargo User Role and Label

  • WPCargo Driver – wpcargo_driver
  • Branch Manager – wpcargo_branch_manager
  • WPCargo Client – wpcargo_client
  • WPCargo Employee – wpcargo_employee
  • WPCargo Agent – cargo_agent
// In this sample we allow the wpcargo driver to access the Driver report page
function my_custom_export_access_pod_report_callback( $roles ){
        // WPCargo Driver : wpcargo_driver
	$roles[] = 'wpcargo_driver';	
	return $roles;
}
add_filter('can_export_wpcpod_report', 'my_custom_export_access_pod_report_callback');
0
    0
    Your Cart
    Your cart is emptyReturn to Shop