我已经创建了一个插件,其中有一个单独的页面的订单列表..它看起来像WooCommerce的订单列表页面,但是。我无法获得该订单的评论,所以我添加了我的自定义帖子类型到wc_order_types
之后,没有列出订单..它显示一个空表。 ?自定义订单列表页面与WooCommerce
add_filter('wc_order_types',array($this,'add_wc_order_types'),10,3);
public function add_wc_order_types($order_types,$type){
$order_types[] = WC_QD_PT;
return $order_types;
}
感谢。但它不起作用。我在WP_List_Table –
中使用vardump'have_posts()'获得'false'值,那么我猜'wc_order_types'由于某些原因无法检索'$ order_types',你应该尝试找出。 –
我的钩子返回值。我检查了。它 –