Wordpress帖子列表,重复参数

时间:2015-06-02 09:44:55

标签: wordpress-plugin woocommerce wordpress

这是一个包含参数post_typepost_status的WordPress网址。

https://www.example.co.uk/wp-admin/edit.php?post_type=shop_order&post_status=wc-pending

我需要两个post_status,因此查询会同时获取两个,这在查询中会是OR条件,但这需要编辑核心。

https://www.example.co.uk/wp-admin/edit.php?post_type=shop_order&post_status=wc-pending&post_status=wc-processing

这只会抓取wc-processing,当我想要它时,两次抓取wc-processingwc-pending

有没有这样做,以便我不必编辑WordPress的核心文件?

1 个答案:

答案 0 :(得分:1)

post status parameters接受一个数组:

https://www.example.co.uk/wp-admin/edit.php?post_type=shop_order&post_status[]=wc-pending&post_status[]=wc-processing