Commit c5bc2eeb authored by haystack's avatar haystack 🤔

do not implement rewrite rules during installation

parent e09a55a3
...@@ -610,25 +610,29 @@ class CiviCRM_For_WordPress { ...@@ -610,25 +610,29 @@ class CiviCRM_For_WordPress {
// Register user hooks // Register user hooks
$this->users->register_hooks(); $this->users->register_hooks();
// Have we flushed rewrite rules? // If CiviCRM is installed, we can use clean URLs.
if ( get_option( 'civicrm_rules_flushed' ) !== 'true' ) { if ( CIVICRM_INSTALLED ) {
// Apply custom rewrite rules, then flush rules afterwards // Have we flushed rewrite rules?
$this->rewrite_rules( true ); if ( get_option( 'civicrm_rules_flushed' ) !== 'true' ) {
// Set a one-time-only option to flag that this has been done // Apply custom rewrite rules, then flush rules afterwards
add_option( 'civicrm_rules_flushed', 'true' ); $this->rewrite_rules( true );
} else { // Set a one-time-only option to flag that this has been done
add_option( 'civicrm_rules_flushed', 'true' );
// Apply custom rewrite rules normally } else {
$this->rewrite_rules();
} // Apply custom rewrite rules normally
$this->rewrite_rules();
// Add our query vars }
add_filter( 'query_vars', array( $this, 'query_vars' ) );
// Add our query vars
add_filter( 'query_vars', array( $this, 'query_vars' ) );
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment