From bd703ffa52982839f2981203efcb80b9fa5ec80e Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 13 Jul 2010 21:56:49 +0000 Subject: [PATCH] get_post_permalink() should take a post ID and pass the post object to the filter. Note that the filter received a post object previously as the variable. props filosofo, fixes #14299 for trunk. git-svn-id: http://svn.automattic.com/wordpress/trunk@15411 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 9e37cd4a2..c76979672 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -108,7 +108,7 @@ function get_permalink($id = 0, $leavename = false) { elseif ( $post->post_type == 'attachment' ) return get_attachment_link($post->ID); elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) ) - return get_post_permalink($post, $leavename, $sample); + return get_post_permalink($post->ID, $leavename, $sample); $permalink = get_option('permalink_structure'); @@ -204,7 +204,7 @@ function get_post_permalink( $id = 0, $leavename = false, $sample = false ) { $post_link = home_url($post_link); } - return apply_filters('post_type_link', $post_link, $id, $leavename, $sample); + return apply_filters('post_type_link', $post_link, $post, $leavename, $sample); } /**