No, not correct - get_user_meta()
returns meta data based on the $user_id
parameter you provide. You can combine it with get_current_user_id()
to check if an user is logged in and than - if so - get the post meta. E.g. like this:
$curr_user_id = get_current_user_id();
// the value is 0 if the user isn't logged-in
if ( $curr_user_id != 0 ) {
// we know now the user is logged-in, so we can use his/her ID to get the user meta
$um_value = get_user_meta( $curr_user_id, 'your-key', true );
// now we check if the value is correct
if ( ! empty( $um_value ) && $um_value == 'your-value' ) {
// if so we can output something
echo 'user meta has the value';
}
}