Ver Fonte

Merge pull request #477 from cfoellmann/flush

added flush_rewrite_rules on Theme switch
Eddie Machado há 12 anos atrás
pai
commit
5de8256e57
1 ficheiros alterados com 7 adições e 0 exclusões
  1. 7 0
      library/custom-post-type.php

+ 7 - 0
library/custom-post-type.php

@@ -14,6 +14,13 @@ Developed by: Eddie Machado
 URL: http://themble.com/bones/
 */
 
+// Flush rewrite rules for custom post types
+add_action( 'after_switch_theme', 'bones_flush_rewrite_rules' );
+
+// Flush your rewrite rules
+function bones_flush_rewrite_rules() {
+	flush_rewrite_rules();
+}
 
 // let's create the function for the custom type
 function custom_post_example() {