Created
April 28, 2020 15:10
-
-
Save Spellhammer/000b3b7dd11ddc467ec50c90a10441d2 to your computer and use it in GitHub Desktop.
Get field from current user's Profile (ACF)
This file contains hidden or 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 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