From 22147bfbfb7d965a3f39f8f4aaa35df6efff4f06 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 8 Jul 2014 15:47:20 +0000 Subject: [PATCH] Pass the post object rather than the post ID between the post permalink functions. Fixes #28425. Props arnee git-svn-id: https://develop.svn.wordpress.org/trunk@29024 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 9763c81523..3b9533181a 100644 --- a/src/wp-includes/link-template.php +++ b/src/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');