......
add_filter('woocommerce_order_actions', [__CLASS__, 'addCreateDealOrderAction']);
add_action('woocommerce_order_action_create_deal', [__CLASS__, 'handleCreateDealOrderAction']);
......
public static function addCreateDealOrderAction($actions)
{
$actions['create_deal'] = 'Create deal in Teamleader';
return $actions;
}
public static function handleCreateDealOrderAction($order)
{
update_post_meta($order->get_id(), 'my_field', 'bla bla');
}
var_dump( update_post_meta($order->get_id(), 'my_field', 'bla bla') );
die;
public static function handleCreateDealOrderAction($order)
{
if(isset($_POST['my_field'']))
unset($_POST['my_field']);
update_post_meta($order->get_id(), 'my_field', 'bla bla');
}