Support

Account

Home Forums General Issues Passing map array item as value in meta query

Unread

Passing map array item as value in meta query

  • I have a cf of type map, which stores data in an array, including country, city, state, etc.

    I’m trying to do a query with a meta query where the key will be an item of the array not the whole array. Like so.

    
    'meta_query' => array(
    		
    		array(
    
    'key' => get_field('location')['country'],
    			'value' => 'Italy',
    			'compare' => 'LIKE'
    		)
    	)
    

    But it doesn’t work. It works ok if the key value passed is the whole map field (array) like so:

    'key' => 'location'

    Any ideas?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.