How to Flush Permalink Rules with flush_rules(): "If we want to create our own permalinks for custom post types, we can do so by using the WP_Rewrite WordPress object.
We can also create our own permalink rules from scratch, by using the same object.
One very important function while creating permalink rules is the $wp_rewrite->flush_rules() function. This function does the following -
Deletes the ‘rewrite_rules’ option. This is where all the permalink rules for our blog are stored. When someone clicks on one of our blog pages, the parse_request function retrieves these rewrite rules and translates them into a query request."
No comments:
Post a Comment