Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi,
    That might work. Did you try it out?

    Thread Starter mreee

    (@mreee)

    Yes, it didn’t work for me. I also tried
    'meta_value' => array("For Sale", "For Rent")
    But that didn’t work either.

    Plugin Author Darren Cooney

    (@dcooney)

    Hi,
    yea just checked the codex for wp_query. meta_value only support one term.

    Thread Starter mreee

    (@mreee)

    WP_query can filter meta_values by an array if it is not inside a meta_query array.

    Example WP_query variables:

    $args = array( 'post_type' => 'property', 'posts_per_page' => -1, 'meta_key'=> "sold_or_for_sale", 'meta_value' => array("For Sale", "For Rent") );

    Or is this something different?

    Plugin Author Darren Cooney

    (@dcooney)

    Actually, yes I was wrong… it looks like a WP meta_query does in fact support an array of values.

    The issue is that ALM is only expecting a single value (or string value). I’ll put a fix in place for v2.5 which I hope to release sometime next week.

    Plugin Author Darren Cooney

    (@dcooney)

    When I eventually push this update you need to read this on the docs.

    value (string|array) – Custom field value. It can be an array only when compare is ‘IN’, ‘NOT IN’, ‘BETWEEN’, or ‘NOT BETWEEN’. You don’t have to specify a value when using the ‘EXISTS’ or ‘NOT EXISTS’ comparisons in WordPress 3.9 and up.

    You can only use an array of values when compare is:

    ‘IN’, ‘NOT IN’, ‘BETWEEN’, or ‘NOT BETWEEN’

    Thread Starter mreee

    (@mreee)

    Thank you! Your plugin is awesome. I have been using it on every site I create since I found it.

    Plugin Author Darren Cooney

    (@dcooney)

    No problem. Glad to hear it!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Is it possible to search for multiple meta values?’ is closed to new replies.