Permalink
Browse files

Flush Rewrite rules on plugin activation only

  • Loading branch information...
1 parent 84bebe8 commit f7aaa99306417d6c51663f92c031d475a99c5181 @jeherve committed Mar 14, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 wp-fb-applications.php
View
@@ -60,10 +60,15 @@ function werewp_fbapp_post_type() {
'taxonomies' => array( 'app_id', 'app_secret', 'app_fbcomments' ),
)
);
- flush_rewrite_rules();
}
add_action( 'init', 'werewp_fbapp_post_type' );
+// Flush rewrite rules when the plugin is activated
+function werewp_flush_rewrite() {
+ flush_rewrite_rules();
+}
+register_activation_hook( __FILE__, 'werewp_flush_rewrite' );
+
// Add support for thumbnails
add_post_type_support( 'werewp_fbapp', 'thumbnail' );

0 comments on commit f7aaa99

Please sign in to comment.