Skip to content

Instantly share code, notes, and snippets.

@tomjn tomjn/gist:9796bfe1ef0cae28451a Secret
Last active Dec 21, 2015

Embed
What would you like to do?
<?php
// All of these will fail miserably:
class MyClass {
function __construct() { }
}
// no function named MyClass
add_action( 'admin_init', 'MyClass' );
// not a callable value
$var = new MyClass();
add_action( 'admin_init', array( &$var ) );
// Plain heresey of the highest order, also it's non-working heresey
add_action( 'admin_init', array( &$var, '__construct' ) );
// this isn't a callable value either
add_action( 'admin_init', 'MyClass::__construct' );
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.