Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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 );
share|improve this answer

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?

share|improve this answer
    
Yes, i also thought about going that way. But anyway it takes me wonder if, it's possible this way.. –  mnewmedia Nov 12 '12 at 11:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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