Home › Forums › General Issues › Can get_field be set with an array/multiple values? › Reply To: Can get_field be set with an array/multiple values?
I forgot to add I’m trying to use a second value for “get_field(‘region’),” which should be an “or relation” if region is “online” or “learning center”.
currently have this:
<?php
$today = current_time('Y-m-d');
$args = array (
'meta_query' => array(
'relation' => 'AND',
array(
'category' => 'events',
'key' => 'end_date',
'value' => $today,
'compare' => '>=',
'type' => 'DATE',
),
array(
'key' => 'region',
'value' => get_field('region'),
'compare' => '='
),
),
'meta_key' => 'start_date',
'orderby' => 'meta_value',
'order' => 'DSC',
'posts_per_page' => 6,
'category_name' => 'events',
'paged' => 1,
);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?
— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.