<?php namespace test; class MyPlugin { public function __construct() { add_action('foo', [__NAMESPACE__ . '\MyPlugin', 'do_something_static']); } public static function do_something_static() { echo "If you read this, calling " . __FUNCTION__ . " worked\n"; } } call_user_func( array( __NAMESPACE__ . '\MyPlugin', 'do_something_static' ) ); call_user_func( __NAMESPACE__ . '\MyPlugin::do_something_static' ); call_user_func( 'test\MyPlugin::do_something_static' );
You have javascript disabled. You will not be able to edit any code.