[英]How can I add and remove actions in the WooCommerce multiple actions dropdown?
I'm figuring out how I can add / remove actions to the multiple actions dropdown in WooCommerce orders overview:我正在弄清楚如何向 WooCommerce 订单概述中的多个操作下拉列表添加/删除操作:
I've added some custom order statuses which I want to add here so that I can select some orders and set them all to my custom status 1 for example.我添加了一些我想在此处添加的自定义订单状态,以便我可以选择一些订单并将它们全部设置为我的自定义状态 1。 I also need to remove some actions here because I don't need them.
我还需要在这里删除一些操作,因为我不需要它们。 How can I do this?
我怎样才能做到这一点?
To add an action to change order status.添加操作以更改订单状态。 Add an action with the index start at "mark_" and then the status name.
添加索引以“mark_”开头的操作,然后是状态名称。
For example "mark_shipped".例如“mark_shipped”。
add_filter( 'bulk_actions-edit-shop_order', 'custom_shop_order_bulk_actions', 20 );
function custom_shop_order_bulk_actions( $actions ) {
unset( $actions['mark_processing'] ); // remove action
$actions['mark_new_status'] = __( 'Change status to new status' );
return $actions;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.