Introduce previous_image_link and next_image_link filters. Allows customizing the gallery display order.
Props nacin fixes #22829 for trunk git-svn-id: http://core.svn.wordpress.org/trunk@23139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3f0f56d58d
commit
fe8a8c9af4
|
@ -836,8 +836,14 @@ function adjacent_image_link($prev = true, $size = 'thumbnail', $text = false) {
|
|||
|
||||
$k = $prev ? $k - 1 : $k + 1;
|
||||
|
||||
if ( isset($attachments[$k]) )
|
||||
echo wp_get_attachment_link($attachments[$k]->ID, $size, true, false, $text);
|
||||
$output = $attachment_id = null;
|
||||
if ( isset( $attachments[ $k ] ) ) {
|
||||
$attachment_id = $attachments[ $k ]->ID;
|
||||
$output = wp_get_attachment_link( $attachment_id, $size, true, false, $text );
|
||||
}
|
||||
|
||||
$adjacent = $prev ? 'previous' : 'next';
|
||||
echo apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue