Skip to content

Instantly share code, notes, and snippets.

@Spellhammer
Created April 28, 2020 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spellhammer/000b3b7dd11ddc467ec50c90a10441d2 to your computer and use it in GitHub Desktop.
Save Spellhammer/000b3b7dd11ddc467ec50c90a10441d2 to your computer and use it in GitHub Desktop.
Get field from current user's Profile (ACF)
// Get field from current user's profile
function get_user_field( $field_name ) {
if( !$field_name ) { return; }
$user = "user_" . get_current_user_ID();
if( $field_name ) {
return get_field( $field_name, $user );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment