Callback called twice when method name and class name is same
-
Hi,
I just came across an issue that added callbacks with
add_action()gets called twice, which I did not expect. I’m not sure whether this is an expected behavior or not.class Tester { public function tester() { error_log( __METHOD__ . ' called' ); } public function testSomething() { error_log( __METHOD__ . ' called' ); } } $_oTest1 = new Tester; add_action( 'plugins_loaded', array( $_oTest1, 'tester' ) ); add_action( 'plugins_loaded', array( $_oTest1, 'testSomething' ) );You’ll see the method
tester()gets called twice whiletestSomething()is called only once.Is this a bug or by design?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Callback called twice when method name and class name is same’ is closed to new replies.