My plugin has custom Post Types that open on a custom page triggered by the following hook:
add_filter ('template_include', 'taxonomy_template'); // PRINTING PAGE
however, this page only appears when I access the menu:
Settings > Permanent Links
and saved without even changing anything, is there a hook that makes this check and saves automatically?
My plugin has custom Post Types that open on a custom page triggered by the following hook:
add_filter ('template_include', 'taxonomy_template'); // PRINTING PAGE
however, this page only appears when I access the menu:
Settings > Permanent Links
and saved without even changing anything, is there a hook that makes this check and saves automatically?
Share Improve this question asked Nov 5, 2020 at 18:17 Alisson CustodioAlisson Custodio 12 bronze badges 5 |1 Answer
Reset to default 0The solution found was to update the rewrite rules right after registering my new post type, using this code at the end of the function:
flush_rewrite_rules();
template_include
examples – Howdy_McGee ♦ Commented Nov 5, 2020 at 18:22