-
Notifications
You must be signed in to change notification settings - Fork 10
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
Flush rewrite rules network-wide when network-activated #37
Conversation
@kucrut you mentioned on Skype the proper-network-activation plugin. Great find! The plugin README should get updated to note that this plugin should be installed and network-activated before attempting to network-activate Dependency Minification. Also as we discussed, it would be awesome to filter the Your proposed solution (via Otto) to remove the rewrite rule upon deactivation is great: static function deactivate() {
$regex = sprintf( '^%s/%s', self::$options['endpoint'], self::FILENAME_PATTERN );
global $wp_rewrite;
unset( $wp_rewrite->extra_rules_top[ $regex ] );
flush_rewrite_rules();
} Just refactor the assignment of the |
network-activating Dependency Minification
else { | ||
$activate_pna_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $pna_plugin_file, 'activate-plugin_' . $pna_plugin_file ); | ||
$links['activate'] = '<a href="' . $activate_pna_url . '" title="' . esc_attr__('Activate Proper Network Activation plugin') . '" class="edit">' . __('Activate PNA') . '</a>'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kucrut very well done! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, haha! I just realized that this is not going to actually do anything! This function is not going to get a chance to filter network_admin_plugin_action_links
because this plugin is not even activated yet 😄
So I guess the alternative we'll have to resort to is add a warning in the description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL. Silly me. It was working because the plugin was already activated in the main site 😄
@@ -1,7 +1,7 @@ | |||
<?php | |||
/* | |||
Plugin Name: Dependency Minification | |||
Description: Concatenates and minifies scripts and stylesheets. | |||
Description: Concatenates and minifies scripts and stylesheets. Please install and activate <a href="http://scribu.net">scribu</a>'s <a href="http://wordpress.org/plugins/proper-network-activation/">Proper Network Activation</a> plugin <em>before</em> activating this plugin <em>network-wide</em>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kucrut beauty!
Improve network activation and deactivation * Flush rewrite rules network-wide when network-activated * Prompt for installing @scribu's Proper Network Activation plugin
On a multisite network, I also noticed that when the plugin network-activated, it does not flush the rewrite rules across all sites on the network, which will result in broken CSS and JS until someone visits the Permalinks page for each site in the network. This is not acceptable.