tags – Permalink refresh, the good, the bad, etc. What is best?

Question

I have written various functions/plugins and they require Permalinks to be refreshed, or switched form settings plain then back to to post name in Permalinks settings; to make urls of custom post types function with the newly added /url/ in the address that are from new categories or tags, etc. I found a few automatic methods of this Permalinks refresh shown below. Some people write that doing this refresh slows down the website.?? Is it true it slows the website?

option #1 :

add_action('wp_insert_category', function () { flush_rewrite_rules(true); }, 10, 2);

option #2 :

flush_rewrite_rules();

I don’t think I got the first one to work but the second one surely works good. #2 works good. But is there a better option? A way to do this to not slow down the website?

Thanks! Have a great day!!

0
Angel Hess 1 month 2021-08-13T18:57:52-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse