下面的代碼有區別嗎?究竟有什麼區別?Php snippet comparison
$args = array(
'post_type' => $post_type,
'numberposts' => -1,
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => $meta_key,
'value' => $meta_value,
'compare' => 'LIKE'
),
)
);
則爲:
$args = array(
'post_type' => $post_type,
'numberposts' => -1,
'post_status' => 'publish',
);
$args['meta_query'][] = array(
'key' => $meta_key,
'value' => $meta_value,
'compare' => 'LIKE');
}
謝謝!
看起來相同 – DevZer0
似乎沒有什麼區別,在最後。 – TroyCheng