Skip to content

Instantly share code, notes, and snippets.

View suxur's full-sized avatar

Joshua Payne suxur

View GitHub Profile
@feedmeastraycat
feedmeastraycat / woocommerce_order_actions.php
Last active March 9, 2016 11:09
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
@henrikbjorn
henrikbjorn / CommandAutotestCommand.php
Created September 5, 2011 10:48
Symfony2 autotest runner (Using everzet ResourceWatcher component)
<?php
namespace Diveshare\DiveshareBundle\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Diveshare\DiveshareBundle\Test\Autorunner;
class AutotestCommand extends \Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
{