Skip to content

Instantly share code, notes, and snippets.

@tomjn tomjn/gist:ebcc00d0ef8b6964ec62 Secret
Created Aug 21, 2013

What would you like to do?
// Using static methods
class Work {
public function __construct() {
// do work
public static function new_instance() {
return new Work();
add_action( 'admin_init', array( 'Work', 'new_instance' ) );
// Using Closures
add_action( 'admin_init', function() {
// do work
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.