Support

Account

Home Forums General Issues Get array of term id's from multi-select checkbox to use in query

Unread

Get array of term id's from multi-select checkbox to use in query

  • I want to get the array of term id’s from a multi-select checkbox to use in a query.

    $terms_from_multi_select_checkbox = get_field(‘multi_select_checkbox’);

    $args = array(
    ‘post_type’ => ‘some_post_type’,
    ‘tax_query’ => array(
    array(
    ‘taxonomy’ => ‘some_taxonomy’,
    ‘field’ => ‘term_id’,
    ‘terms’ => array($terms_from_multi_select_checkbox),
    ),
    ),
    );

    How can I get this to work?

Viewing 1 post (of 1 total)

The topic ‘Get array of term id's from multi-select checkbox to use in query’ is closed to new replies.