custom post types – Relationship between set rewrite flag in register_post_type and add_rewrite_rule
Question
In register_post_type, I can register a custom post type and set parameters, including rewrite. Based on https://developer.wordpress.org/reference/functions/register_post_type/#rewrite, 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?
0
10 months
2021-10-12T17:19:25-05:00
2021-10-12T17:19:25-05:00 0 Answers
0 views
0
Leave an answer