Skip to content
Docs
Get RestroPress

Filter

rpress_edit_customers_role

Updated
On this page

Filters the capability required to edit, delete or restore customers.

Evaluated at the start of the customer admin handlers: editing a customer, adding, removing or setting primary emails, disconnecting the linked user, verifying an account, moving to trash, restoring, permanent deletion and bulk actions. It also decides whether the Edit Customer button appears on the customer profile. The default is edit_shop_payments.

Parameters#

ParameterTypeDescription
$capabilitystringThe capability name to require. Defaults to 'edit_shop_payments'.

Return value#

string. The capability name to require.

Example#

function my_edit_customers_capability( $capability ) {
	return 'manage_shop_settings';
}
add_filter( 'rpress_edit_customers_role', 'my_edit_customers_capability' );

Source#

Applied in:

  • includes/admin/customers/customer-actions.php (line 13), in rpress_edit_customer()
  • includes/admin/customers/customer-actions.php (line 144), in rpress_add_customer_email()
  • includes/admin/customers/customer-actions.php (line 221), in rpress_remove_customer_email()
  • includes/admin/customers/customer-actions.php (line 263), in rpress_set_customer_primary_email()
  • includes/admin/customers/customer-actions.php (line 454), in rpress_customer_delete()
  • includes/admin/customers/customer-actions.php (line 497), in rpress_customer_restore()
  • includes/admin/customers/customer-actions.php (line 528), in rpress_customer_delete_permanently()
  • includes/admin/customers/customer-actions.php (line 596), in rpress_customers_list_table_process_bulk_actions()
  • and 3 more places.

See also#

Was this page helpful?