Wordpress custom field and user meta comparison operators
I'm trying to query a user field value. Basically I want to use an if
statement based on whether the current user ID matches the custom field ID
value in order to show user specific content. I've had a few goes with
some code snippets but I can't seem to get anything working.
I've looked briefly into comparison operators and tried to get the below
code to work with no success. New to PHP so be gentle :/
<?php
$client_id = get_currentuserinfo($user_ID);
if ($client_id == get_field('user_select')) :
?>
<p>Working</p>
<?php else : ?>
<p>Not Working</p>
<?php endif; ?>
Any help is mega appreciated!
No comments:
Post a Comment