How to get a value from an array in meta_value
-
Hi there,
I’ve created a table with combo box in my form of post new item to choose multiple data and save it in meta_value of postmeta table
I want to check if a value is in array of this meta_value, I’ve tried this code but I don’t know the valid syntax:
$univ = array( 'key' => 'closed', 'value' => array ("I don'y know what can I put there) , 'compare' => 'IN' ); $prs_string_qu = wp_parse_args($query_string); $prs_string_qu['meta_query'] = array($univ); $prs_string_qu['meta_key'] = 'UNIV'; // name of meta_key in my table $prs_string_qu['orderby'] = 'meta_value'; $prs_string_qu['order'] = 'DESC'; query_posts($prs_string_qu); // and what can I put there $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $term_title = $term->name;
Any help will be appreciated, Thanks in advance
- The topic ‘How to get a value from an array in meta_value’ is closed to new replies.