Skip to content

Instantly share code, notes, and snippets.

@FullStackAlex
Last active September 12, 2019 12:34
Show Gist options
  • Save FullStackAlex/d3f28cf3da52f5d343de2e37dd992ed5 to your computer and use it in GitHub Desktop.
Save FullStackAlex/d3f28cf3da52f5d343de2e37dd992ed5 to your computer and use it in GitHub Desktop.
Use class method in WordPress action hook
require_once( get_template_directory() . "/path/to/OtherClass.php" );
use Namespace\OfThe\OtherClass;
(...)
'callback' => 'OtherClass::SomeStaticMethod'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment