custom post types – Relationship between set rewrite flag in register_post_type and add_rewrite_rule


In register_post_type, I can register a custom post type and set parameters, including rewrite. Based on, if it set to true, then the rewrite for this type of post will be handled.

Then I add some rewrite rules for the custom type of post by invoking add_rewrite_rule in custom_rewrite_basic function.

However, on my tests, I find even I set rewrite to false, the rule set by add_rewrite_rule will still work, why?

alancc 10 months 2021-10-12T17:19:25-05:00 0 Answers 0 views 0

Leave an answer