extended-cpts
extended-cpts copied to clipboard
Incorrect rewrite rule tests generated for certain permastructs
Seems to affect permastructs which use something other than the post type slug as a prefix. Needs investigating further.
Example:
register_extended_post_type( 'foo', array(
'rewrite' => array(
'permastruct' => '/bar/%foo%/%post_id%'
),
) );
Two of the generated tests fail:
Rewrite Test: index.php?foo=$matches[1]&paged=$matches[2]
Rewrite Result: index.php?foo=$matches[1]&p=$matches[2]&page=$matches[3]
Matched: bar/(.+?)/([0-9]+)(/[0-9]+)?/?$
Rewrite Test: index.php?foo=$matches[1]&page=$matches[2]
Rewrite Result: index.php?foo=$matches[1]&p=$matches[2]&page=$matches[3]
Matched: bar/(.+?)/([0-9]+)(/[0-9]+)?/?$
And one rewrite rule is missing a test:
bar/(.+?)/page/?([0-9]{1,})/?$