Skip to content

Instantly share code, notes, and snippets.

@sabrina-zeidan
Created November 13, 2020 20:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sabrina-zeidan/72e48da602dedf43345b4aa852ecfbe4 to your computer and use it in GitHub Desktop.
Save sabrina-zeidan/72e48da602dedf43345b4aa852ecfbe4 to your computer and use it in GitHub Desktop.
Get all ACF's assigned to user profile
// 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