-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
I'm getting some errors from wp-cli, due to the add-to-any plugin is defining their variables in the global scope.
See answer from micropat:
https://wordpress.org/support/topic/a2a_share_save_plugin_dir-not-set-and-breaks-wp-cli?replies=6#post-7650210
This is a WP-CLI issue, not an AddToAny issue.
Using a reduced test case, WP-CLI 0.21.0 fails, but WP-CLI 0.20.2 worked.
// Already global scope, so the global keyword isn't used.
//global $a_global_var;
$a_global_var = 'Of course.';
function foo() {
global $a_global_var;
if ( empty( $a_global_var ) ) {
$a_global_var = 'Nope!';
}
die( 'Is global scope behaving? ' . $a_global_var . " \n" );
}
foo();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels