• Is it possible to use arrays in a custom query?

    Let’s say i have such an array

    ‘meta_query’ => array(
    ‘key’ => ‘sorting’,
    ‘value’ => 0,
    ),
    Can I write it in the query string?

    tried to write like this:

    meta_query[]key=sorting&meta_query[]value=0

Viewing 1 replies (of 1 total)
  • Plugin Author nK

    (@nko)

    Hi.

    We use parse_str PHP function to convert string query to an array, so you can use it.

    Make sure you prepared meta_query properly (array of arrays):

    array(
    	'meta_query' => array(
    		array(
    			'key'     => 'sorting',
    			'value'   => 0,
    		),
    	),
    ),
    
    
    Regards, nK.
Viewing 1 replies (of 1 total)

The topic ‘Custom_query’ is closed to new replies.