Permalink
Browse files

Flush the rewrite rules later

Just to make sure that we don't overwrite other
plugins' rules if they add them on init, but after
ours.

Fixes #25, props @danielbachhuber
  • Loading branch information...
1 parent 7994c3e commit 4221823edaf812142f84d578a59d004fd7771616 @nb nb committed Sep 18, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 liveblog.php
View
@@ -94,7 +94,8 @@ private static function add_actions() {
add_action( 'init', array( __CLASS__, 'init' ) );
add_action( 'init', array( __CLASS__, 'add_rewrite_rules' ) );
add_action( 'permalink_structure_changed', array( __CLASS__, 'add_rewrite_rules' ) );
- add_action( 'init', array( __CLASS__, 'flush_rewrite_rules' ) );
+ // flush the rewrite rules a lot later so that we don't interfere with other plugins using rewrite rules
+ add_action( 'init', array( __CLASS__, 'flush_rewrite_rules' ), 1000 );
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
add_action( 'wp_ajax_liveblog_insert_entry', array( __CLASS__, 'ajax_insert_entry' ) );
add_action( 'wp_ajax_liveblog_preview_entry', array( __CLASS__, 'ajax_preview_entry' ) );

0 comments on commit 4221823

Please sign in to comment.