﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
18040	Turning on permalinks, CPT rewrites are ignored	andy		"I'm working on rewrite issues in a plugin that registers custom post types. Everything works perfectly if rewrite rules already exist. However, when switching away from the default permalinks (?p=123), no CPT rewrite rules are added. I have to trigger another flush (e.g. by reloading the Permalink Settings page) before the CPT rules appear and my plugin's URLs work.

This bug is due to [http://core.trac.wordpress.org/browser/trunk/wp-includes/post.php?rev=18367#L988 this check]. When switching from no permalink_structure to some permalink_structure, the empty permalink_structure option prevents the rewrite rules and permastructs being added, even though they should be allowed in this case. The result is that the rewrite_rules are generated without any CPT rules.

I suppose the option check is purely for performance reasons. The simplest fix would be to omit the option check which would cause register_post_type to take a little bit longer than necessary on sites without a permalink structure. If this is unacceptable, the fix can ignore the option when is_admin() (or some other test)."	defect (bug)	closed	normal	3.3	Post Types	3.2	normal	fixed	has-patch commit	pavelevap@…
