functions.php of my theme I'm registering 5 custom post types. Each having a custom taxonomy, which I'm rewriting the url based upon. Meaning the custom post URL becomes
For example the post "Childrens book no. 1" of the custom post type "books" with the category "Childrens books" would become
Whenever I register a new post type I need to flush the rewrite rules in order to get the permalink taxonomy rewrite to work.
So in order to not use
flush_rewrite_rules() more often than needed, when do I use it?
I understand theres a
registered_post_type() hook, but it seems to fire every time the admin is reloaded, making it a rather resource consuming operation.
Is there a hook that only fires when a new post type is registered?