diff --git a/src/class-config.php b/src/class-config.php index 27724e1..51ce62c 100644 --- a/src/class-config.php +++ b/src/class-config.php @@ -729,7 +729,7 @@ protected function register_graphql_field( $type_name, $field_name, $config ) { $type = $tax_object->graphql_single_name; } } - + $is_multiple = isset($acf_field['field_type']) && in_array( $acf_field['field_type'], array('checkbox', 'multi_select')); $field_config = [ @@ -1561,10 +1561,23 @@ protected function add_acf_fields_to_users() { 'user_form' => 'register', ] ); + $user_role_field_groups = []; + /** + * Get the fields groups associated with the User + */ + foreach( wp_roles()->roles as $role_slug => $role ) { + + $field_role_groups = acf_get_field_groups([ + 'user_role' => $role_slug, + ]); + + $user_role_field_groups = array_merge( $user_role_field_groups, $field_role_groups ); + } + /** * Get a unique list of groups that match the register and edit user location rules */ - $field_groups = array_merge( $user_edit_field_groups, $user_register_field_groups ); + $field_groups = array_merge( $user_edit_field_groups, $user_register_field_groups, $user_role_field_groups ); $field_groups = array_intersect_key( $field_groups, array_unique( array_map( 'serialize', $field_groups ) ) );