Advanced Order Export for WooCommerce

Limit Access

By default, only users with administrator privileges can access the export feature. However, real‑world stores often need to delegate this task to shop managers, accounting staff, or external assistants without granting full administrative rights.

Restricting Access to Administrators Only

The example demonstrates how to enforce that only users with the administrator role can access the export feature.

What this code does:

  1. Attaches an anonymous function to the woe_current_user_can_export filter.
  2. Retrieves the current user object using wp_get_current_user().
  3. Checks whether the user’s roles array contains the administrator role.
  4. Returns true if the user is an administrator, otherwise false.

This is functionally identical to the default behaviour. However, it demonstrates how you can replace the default capability check with a role‑based condition.

Have questions? Please submit a support request. We're always happy to help!

Advanced Order Export
for WooCommerce
PRO

From $30
Buy
✓ 30-day money-back guarantee