-
-
Save tomjn/9796bfe1ef0cae28451a to your computer and use it in GitHub Desktop.
This file contains 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 | |
// 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