WordPress at a glance
function is not described

wc_modify_editable_roles() WC 1.0

Modify the list of editable roles to prevent non-admin adding admin users.

Hooks from the function
Return

Array. Nothing.

Usage

wc_modify_editable_roles( $roles );
$roles(array) (required)
Roles.

Code of wc_modify_editable_roles() WC 5.3.0

<?php
function wc_modify_editable_roles( $roles ) {
	if ( is_multisite() && is_super_admin() ) {
		return $roles;
	}
	if ( ! wc_current_user_has_role( 'administrator' ) ) {
		unset( $roles['administrator'] );

		if ( wc_current_user_has_role( 'shop_manager' ) ) {
			$shop_manager_editable_roles = apply_filters( 'woocommerce_shop_manager_editable_roles', array( 'customer' ) );
			return array_intersect_key( $roles, array_flip( $shop_manager_editable_roles ) );
		}
	}

	return $roles;
}