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
wp plugin activate
If a plugin generates output during activation, activate_plugin will return an WP_Error object configured like this:
activate_plugin
WP_Error
$output = ob_get_clean(); return new WP_Error( 'unexpected_output', __( 'The plugin generated unexpected output.' ), $output );
As you can see, the output is passed as the third parameter, and the error has code "unexpected_output".
I have a use-case where I need the output that was generated for logging reasons.
Relevant code that should print the output:
extension-command/src/Plugin_Command.php
Lines 347 to 354 in 409b3f6
The text was updated successfully, but these errors were encountered:
Hey @Luc45,
Thanks for the suggestion!
I'm a little hesitant about changing the output solely for this use case.
What do you think about instead running the $result through an action, so your custom code can capture and report the output however you need?
$result
Sorry, something went wrong.
No branches or pull requests
If a plugin generates output during activation,
activate_plugin
will return anWP_Error
object configured like this:As you can see, the output is passed as the third parameter, and the error has code "unexpected_output".
I have a use-case where I need the output that was generated for logging reasons.
Relevant code that should print the output:
extension-command/src/Plugin_Command.php
Lines 347 to 354 in 409b3f6
The text was updated successfully, but these errors were encountered: