I am using visual composer by http://vc.wpbakery.com/ and when their post grid creator only allows you to use custom post types if you use a query.
I have a simple query working:
post_type=post_mission_trip&post_status=publish&posts_per_page=3
I need to create a more complex one that would do something like this:
$myCompletedResearch = new WP_Query(array(
'post_type' => 'post_mission_trip',
'post_status' => 'publish'
'posts_per_page'=>3,
'orderby'=>'meta_value_num',
'meta_key'=>'trip_begin',
'order'=>'desc',
'meta_query'=>array(
'relation'=>'and',
array(
'key'=>'trip_options',
'value'=>'private_event',
'compare' => '=='
),
array(
'key'=>'trip_limit',
'value'=>'0',
'compare' => '>'
)
)
));
Does anyone know how to convert the arrays inside of it to the format that the visual composer would accept.
WordPress WP_query uses parse_str function to parse given attributes, so opposite function is http_build_query that accepts an array as first argument.
echo http_build_query($arr);