From 32224314a52ac4746ec46dc39c99cc7550c99679 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 8 Jul 2014 15:48:17 +0000 Subject: [PATCH] Pass the post object rather than the post ID between the post permalink functions. Fixes #28425. Props arnee Built from https://develop.svn.wordpress.org/trunk@29024 git-svn-id: http://core.svn.wordpress.org/trunk@28812 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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');