We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I add a hook to a class method;
__NAMESPACE__
<?php declare( strict_types = 1 ); namespace Soderlind\Test; class Test { public function __construct() { add_filter('the_content',__NAMESPACE__ . '\\filter_the_content' ); add_action('init',__NAMESPACE__ . '\\action_init' ); } . . . }
public function __construct() { add_filter('the_content','filter_the_content' ); add_action('init','action_init' ); }
In both cases, the correct is
public function __construct() { add_filter('the_content', [ $this, 'filter_the_content' ] ); add_action('init', [ $this,'action_init' ] ); }
The text was updated successfully, but these errors were encountered:
Thanks, the callback generation in general is quite buggy. I need to revisit it.
Sorry, something went wrong.
No branches or pull requests
When I add a hook to a class method;
__NAMESPACE__
is prefixed the callback name:In both cases, the correct is
The text was updated successfully, but these errors were encountered: