Created
November 13, 2020 20:54
-
-
Save sabrina-zeidan/72e48da602dedf43345b4aa852ecfbe4 to your computer and use it in GitHub Desktop.
Get all ACF's assigned to user profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get all field groups that have location User Add/Edit Form | |
$field_groups = acf_get_field_groups(array( 'user_form' => 'edit')); | |
$all_fields = array(); | |
foreach ($field_groups as $field_group){ | |
$fields = acf_get_fields($field_group['key']); | |
$all_fields = array_merge($all_fields, $fields); //get all user's fields together | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment