use explicit attachment permalink marker for int names. Props andy. fixes #6280
git-svn-id: http://svn.automattic.com/wordpress/trunk@7437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1ec1d3902d
commit
ef8ff2324c
|
@ -179,8 +179,12 @@ function get_attachment_link($id = false) {
|
||||||
$parentlink = _get_page_link( $object->post_parent ); // Ignores page_on_front
|
$parentlink = _get_page_link( $object->post_parent ); // Ignores page_on_front
|
||||||
else
|
else
|
||||||
$parentlink = get_permalink( $object->post_parent );
|
$parentlink = get_permalink( $object->post_parent );
|
||||||
|
if ( ctype_digit($object->post_name) )
|
||||||
|
$name = 'attachment/' . $object->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker
|
||||||
|
else
|
||||||
|
$name = $object->post_name;
|
||||||
if (strpos($parentlink, '?') === false)
|
if (strpos($parentlink, '?') === false)
|
||||||
$link = trailingslashit($parentlink) . $object->post_name . '/';
|
$link = trailingslashit($parentlink) . $name . '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $link ) {
|
if (! $link ) {
|
||||||
|
|
Loading…
Reference in New Issue