Below code return the same results. Is it any difference between them and if it is then which one is better?
code snippet 1:
$args = array(
'post_type' => 'product',
'meta_key' => 'location',
'meta_value' => 'Melbourne'
);
$query = new WP_Query( $args );
code snippet 2:
$args = array(
'post_type' => 'product',
'meta_query' => array(
array(
'key' => 'location',
'value' => 'Melbourne'
),
),
);
$query = new WP_Query( $args );