Skip to content
New issue

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

Rename $plugin to prevent variable name conflict #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions basic-scaffold.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,22 @@
* For more information on why to avoid a Singleton,
* @see https://www.alainschlesser.com/singletons-shared-instances/
*/
$plugin = BasicScaffoldPluginFactory::create();
$pluginObject = BasicScaffoldPluginFactory::create();

/*
* We register activation and deactivation hooks by using closures, as these
* need static access to work correctly.
*/
\register_activation_hook( __FILE__, function () use ( $plugin ) {
$plugin->activate();
\register_activation_hook( __FILE__, function () use ( $pluginObject ) {
$pluginObject->activate();
} );

\register_deactivation_hook( __FILE__, function () use ( $plugin ) {
$plugin->deactivate();
\register_deactivation_hook( __FILE__, function () use ( $pluginObject ) {
$pluginObject->deactivate();
} );

/*
* Finally, we run the plugin's register method to Hook the plugin into the
* WordPress request lifecycle.
*/
$plugin->register();
$pluginObject->register();