Apply CPT changes immediately on submit
-
I found an epic bug after 1 week of Googling, Stackoverflowing and finally the plugin code exploring by myself.
There is no flush_rewrite_rules() call in the function of form submitting when someone creating/modify existing custom post type. There is only flush_rewrite_rules() at edit form “show” stage.
This will make next BAD behaviour:
1. I am creating new post type, set up its properties, set up some not default values (for example, Has Archive = true).
2. I am pressing Submit and post type added and page of list of post types shown.
3. But these specific properties DOES NOT still activated. To activate them I have to just open “edit post type” form again (without submitting). Because I need for flush_rewrite_rules() to be called.So here is my proposition:
PLEASE call flush_rewrite_rules() in the code, which adds or applies custom post type changes, NOT “show form” routine.Thanks!
- The topic ‘Apply CPT changes immediately on submit’ is closed to new replies.