Last active
March 9, 2016 11:09
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
} |
I was so close.. Thanks dude..
Top man, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I almost had this figured out and this helped finish the process. Thanks!