[wp-trac] [WordPress Trac] #27483: Previous/next links not regarding custom post types
WordPress Trac
noreply at wordpress.org
Sat Mar 22 00:22:48 UTC 2014
#27483: Previous/next links not regarding custom post types
-------------------------------+-----------------------------
Reporter: stevengliebe | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
I'm seeing an issue with previous_post_link() and next_post_link() on
single posts that use a custom post type in 3.9 beta 2. The links go to
standard posts instead of the adjacent posts of the same custom post type.
This doesn't happen in 3.8.1. Maybe more specifically it has to do with
the functions that previous_post_link() and next_post_link() use -- an
adjacent post issue.
To recreate the bug:
1. Fresh install of WordPress 3.9 beta 2.
2. Activate Twenty Fourteen theme.
3. Register a custom post type:
{{{
function sg_register_post_type() {
$args = array(
'public' => true,
'label' => 'Test CPT'
);
register_post_type( 'test-cpt', $args );
}
add_action( 'init', 'sg_register_post_type' );
}}}
4. Add three posts using this CPT.
5. View the second post. It should show the first and third posts of the
same type for the prev/next links but instead it shows the "Hello world!"
blog post.
[[Image(http://stevengliebe.com/share/3.9.png)]]
6. Repeat the same on a fresh 3.8.1 install and you see the prev/next
links show as expected for the CPT.
[[Image(http://stevengliebe.com/share/3.8.png)]]
This isn't an issue with Twenty Fourteen. You can switch to other themes
and see the same issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27483>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list