diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 9763c81523..3b9533181a 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -136,11 +136,11 @@ function get_permalink( $id = 0, $leavename = false ) { return false; if ( $post->post_type == 'page' ) - return get_page_link($post->ID, $leavename, $sample); + return get_page_link($post, $leavename, $sample); elseif ( $post->post_type == 'attachment' ) - return get_attachment_link( $post->ID, $leavename ); + return get_attachment_link( $post, $leavename ); elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) ) - return get_post_permalink($post->ID, $leavename, $sample); + return get_post_permalink($post, $leavename, $sample); $permalink = get_option('permalink_structure');