{"id":4381740,"date":"2013-12-05T05:11:05","date_gmt":"2013-12-05T05:11:05","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/permalink-bug-4\/"},"modified":"2016-08-21T13:13:08","modified_gmt":"2016-08-21T13:13:08","slug":"permalink-bug-4","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/permalink-bug-4\/","title":{"rendered":"Permalink Bug"},"content":{"rendered":"<p>Hi,<\/p>\n<p>Thanks for creating this great plugin. It helps me a lot in managing our email campaigns.<\/p>\n<p>I&#8217;ve just noticed a weird bug with permalink, that breaks our permalink structure (returns 404 for archive &amp; single custom post type pages). After digging into the code of the plugin, I see that you use <code>flush_rewrite_rules()<\/code> right after <code>register_post_type()<\/code> function. That causes a lot of unneeded calls to refresh permalinks on every page load, which <em>might<\/em> affect other permalink setup.<\/p>\n<p>Regarding <a href=\"http:\/\/look4wp.com\/register_post_type\">the Codex<\/a>, this function (<code>flush_rewrite_rules()<\/code>) should be called only once when the plugin is activated.<\/p>\n<p>I suggest removing that line (<code>class-chimppress-setup.php<\/code> file, line 72) to make it work properly (after removing this line, our permalink structure works pretty well).<\/p>\n<p>Thanks.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/chimppress\/<\/p>\n","protected":false},"template":"","class_list":["post-4381740","topic","type-topic","status-closed","hentry","topic-tag-custom-post-type","topic-tag-permalink"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4381740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4381740\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4381740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}