Last active
December 16, 2015 20:28
-
-
Save dalethedeveloper/5492196 to your computer and use it in GitHub Desktop.
WordPress Plugin - clear permalinks on Network Upgrade. If you have sites on a WP Network (formerly WPMU) that use custom permalink structures or certain configurations of Custom Post Types it may be necessary to flush permalinks. This hack lets you do that safely across the entire network. Add this file to /wp-content/mu-plugins/ or as a enable…
This file contains 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
<?php | |
/* | |
Plugin Name: MU Clear Permalinks | |
Plugin URI: https://gist.github.com/dalethedeveloper/5492196 | |
Description: Clear all site permalinks when Update Network is used | |
Author: dalethedeveloper | |
Version: 0.1 | |
*/ | |
if( ! function_exists('rhplive_clear_permalinks') ): | |
function rhplive_clear_permalinks($id) { | |
switch_to_blog($id); | |
flush_rewrite_rules(); | |
restore_current_blog(); | |
} | |
endif; | |
add_action('wpmu_upgrade_site','rhplive_clear_permalinks'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment