Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Change plugin structure to ensure it can self-deactivate when the feature is merged into Core #37

Merged
merged 3 commits into from
Mar 30, 2020

Conversation

audrasjb
Copy link
Contributor

This pull request moves everything into functions.php and checks if wp_is_plugins_auto_update_enabled() functions exists before running the plugin’s functions.

Fixes #34

@audrasjb audrasjb added the Core Merge Prerequisite This code that will require an update before merging to core label Mar 30, 2020
@audrasjb audrasjb added this to the 0.4.0 milestone Mar 30, 2020
@audrasjb audrasjb requested a review from pbiron March 30, 2020 19:15
@audrasjb audrasjb self-assigned this Mar 30, 2020
Copy link
Contributor

@pbiron pbiron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed one minor change: adding a newline to the end of main plugin file. Not sure if that is required by WPCS, but is generally good practice (IMHO).

Other than that, this works as expected. I tested it by adding function wp_is_plugins_auto_update_enabled() {} to wp-config.php of a test site and verified that functions.php is not loaded and the plugin becomes a no-op.

So, I think this is ready to merge.

@audrasjb
Copy link
Contributor Author

Thanks @pbiron!

@audrasjb audrasjb merged commit dd0836c into master Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core Merge Prerequisite This code that will require an update before merging to core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the plugin's structure
2 participants