Conversation
…Update contributing instructions a bit.
Contributor
There was a problem hiding this comment.
The active plugins are stored in the WP database as plugin-directory/file.php so plugin.php will need to retained for sites that have block-catalog/plugin.php active.
Completely untested but I think the file can contain something like this:
function update_active_plugin() {
$old_name = basename( __DIR__ ) . '/plugin.php';
$new_name = basename( __DIR__ ) . '/block-catalog.php';
$active_plugins = get_option( 'active_plugins', array() );
foreach ( $active_plugins as $key => $active_plugin ) {
if ( $old_name = $active_plugin ) {
$active_plugins[$key] = $new_name;
}
}
update_option( 'active_plugins', $active_plugins );
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\\update_active_plugin' );
Collaborator
There was a problem hiding this comment.
PR Looks good to me, @dkotter . @peterwilsoncc 's note is interesting, but I would avoid changing active_plugins. Given that this plugin is admin-only, I would just add a note to the changelog asking folks to reactivate.
dsawardekar
previously approved these changes
Oct 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Renames the main plugin file from
plugin.phptoblock-catalog.phpand updates any places that referenced that.Also updates the contributing instructions a bit.
Closes #12
How to test the Change
Verify all changes look correct in this PR and that the plugin still loads
Changelog Entry
Credits
Props @dkotter
Checklist: