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
This commit is contained in:
nacin 2010-07-13 21:56:49 +00:00
parent e3dcb82e26
commit bd703ffa52
1 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ function get_permalink($id = 0, $leavename = false) {
elseif ( $post->post_type == 'attachment' ) elseif ( $post->post_type == 'attachment' )
return get_attachment_link($post->ID); return get_attachment_link($post->ID);
elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) ) 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'); $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); $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);
} }
/** /**