I'd like to retrieve the
wp_post_meta with a unique
meta_value. I've tried
WP_Query but no values are returned and I'm unable to retrieve the
$post_query = new WP_Query( array( 'meta_key' => 'key', 'meta_value' => 'value', 'fields' => 'ids', ) ); $post_ids = wp_list_pluck( $post_query->posts, 'ID' ); return $post_ids;
Using a SQL query returns the
post_id. If possible, I'd like to use
WP_Query or a native function if there's one.