Opened 10 years ago
Closed 9 years ago
#32023 closed defect (bug) (duplicate)
FOUND BUG - REWRITE_RULES need to be fired TWICE!
Reported by: | selnomeria | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Rewrite Rules | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
Please, read carefully. (let's say, i already done: global $wp_rewrite );
For example, i do REGISTER_POST_TYPE in functions.php.
after registering, if i do
$wp_rewrite->flash_rules();
only one time (not on every execution of functions.php, but only once in life[using example checkpoint], after registering that post type ), and when I debug $wp_rewrite:
add_action('wp_head','myfunc');function myfunc(){ var_dump($wp_rewrite->wp_rewrite_rules());exit; }
i see,that my Custom POST_TYPE is not shown.
if i execute (once again,manually, from functions.php)
$wp_rewrite->flash_rules();
then in debug, it shows Well.
then READ:
if i remove REGISTER_POST_TYPE block from functions.php, and do flash_rules only once, then in debug, the old post_type data is still shown!
i have to do flash_rules second time, and after that, it is removed ok.
so, why double flash_rules are needed? i think, it's a bug.
Similar tickets found here : #18594 #21824