Opened 3 years ago

Last modified 3 years ago

#14296 new defect (bug)

Don't show previous post link on orphaned attachments

Reported by: zeo Owned by:
Priority: normal Milestone: Awaiting Review
Component: General Version: 3.0
Severity: normal Keywords: has-patch
Cc:

Description

In function adjacent_post_link(), add check if post parent not empty.

Attachments (1)

14296.diff (693 bytes) - added by zeo 3 years ago.

Download all attachments as: .zip

Change History (2)

zeo3 years ago

comment:1   zeo3 years ago

Test case.

For "back to parent" navigation, in theme template attachments.php or image.php, use:

<?php previous_post_link(); ?>

instead of the usual:

<a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a>

or

if (!empty($post->post_parent))
...
Note: See TracTickets for help on using tickets.