我正在使用 WP_Query 查询列表(自定义帖子类型)并按 ACF 元字段排序结果。该字段包含带有货币符号和逗号分隔的价格值,例如 $100,000。
这是我传递给WP_Query的$args。
$args = array(
'post_type' => 'listing',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_key' => '_listing_price',
'orderby' => 'meta_value',
'order' => 'ASC'
);
$listing_query = new WP_Query($args);
结果:
$0 $0 $100,000 $150,000 $22,000 $320,300 $33,000 $359,000.
但我需要这样的结果:
$0 $0 $22,000 $33,000 $100,000 $150,000 $320,300 $359,000.