Skip to content

Instantly share code, notes, and snippets.

@feedmeastraycat
Last active March 9, 2016 11:09
Show Gist options
  • Save feedmeastraycat/5927658 to your computer and use it in GitHub Desktop.
Save feedmeastraycat/5927658 to your computer and use it in GitHub Desktop.
Took me a couple of minutes to find how you add Order actions in WooCommerce so I thought I might write it down for someone else to Google find.
<?php
add_action('woocommerce_order_actions', 'my_woocommerce_order_actions', 10, 1);
function my_woocommerce_order_actions($actions) {
$actions['my_action'] = "Do my action";
return $actions;
}
add_action('woocommerce_order_action_my_action', 'do_my_action', 10, 1);
function do_my_action($order) {
// Do something here with the WooCommerce $order object
}
@suxur
Copy link

suxur commented Jul 23, 2014

I almost had this figured out and this helped finish the process. Thanks!

@AaronBowie
Copy link

I was so close.. Thanks dude..

@mattsims
Copy link

Top man, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment