Skip to content

Commit

Permalink
flush permalinks harder, and on activation.
Browse files Browse the repository at this point in the history
Close #40
  • Loading branch information
Shelob9 committed Aug 6, 2015
1 parent 0969ed8 commit a24c41f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ private function __construct() {
//flush permalinks if not on an API call and hasn't been done this version.
add_action( 'init', function() {
if( ! isset( $_REQUEST[ vars::$nonce_field ] ) && EPOCH_VER != get_option( 'epoch_ver' ) ) {
flush_rewrite_rules();
global $wp_rewrite;
$wp_rewrite->flush_rules();
update_option( 'epoch_ver', EPOCH_VER );
}
});
Expand Down
10 changes: 10 additions & 0 deletions plugincore.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@ function epoch_bootstrap(){
}

}

register_activation_hook( __FILE__, 'epoch_activate' );
/**
* Flush permalinks on activation
*/
function epoch_activate() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
update_option( 'epoch_ver', EPOCH_VER );
}

0 comments on commit a24c41f

Please sign in to comment.