Skip to content

Commit 20bd3ce

Browse files
committed
added flush_rewrite_rules on Theme switch
1 parent 459ae6f commit 20bd3ce

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

library/custom-post-type.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
URL: http://themble.com/bones/
1515
*/
1616

17+
// Flush rewrite rules for custom post types
18+
add_action( 'after_switch_theme', 'bones_flush_rewrite_rules' );
19+
20+
// Flush your rewrite rules
21+
function bones_flush_rewrite_rules() {
22+
flush_rewrite_rules();
23+
}
1724

1825
// let's create the function for the custom type
1926
function custom_post_example() {

0 commit comments

Comments
 (0)