diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 23bfbf7fbc..8253c3c4b5 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -179,7 +179,7 @@ function get_attachment_link($id = false) { $parentlink = _get_page_link( $object->post_parent ); // Ignores page_on_front else $parentlink = get_permalink( $object->post_parent ); - if ( ctype_digit($object->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') ) + if ( is_numeric($object->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') ) $name = 'attachment/' . $object->post_name; // // is paged so we use the explicit attachment marker else $name = $object->post_name;