0

I'm trying to get with

get_user_meta

the meta_key where the meta_value is 'ive-read-this'

But I do not get the value. What should I do?

2 Answers 2

0

I agree with @Simon Blackbourn, but for arguments sake, here's one technique:

$data = get_user_meta( $user_id );
$data = wp_list_filter( $data, array( 'ive-read-this' ) );
$keys = array_keys( $data );
0

Bearing in mind I haven't seen the rest of your code or know the context of your question, I would suggest that you're doing it wrong: you should always know the name of a usermeta that you're trying to retrieve.

If you're trying to determine if a post has been read by a user, you could save the user ID as a postmeta, maybe that's a better solution?

1
  • Yes, i also thought about going that way. But anyway it takes me wonder if, it's possible this way..
    – mnewmedia
    Commented Nov 12, 2012 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.