Bladeren bron

added flush_rewrite_rules on Theme switch

Christian Foellmann 12 jaren geleden
bovenliggende
commit
20bd3ce0ff
1 gewijzigde bestanden met toevoegingen van 7 en 0 verwijderingen
  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() {