Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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 ) ) );


Expand Down