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
This commit is contained in:
John Blackbourn 2014-07-08 15:48:17 +00:00
parent f44553d78c
commit 32224314a5
1 changed files with 3 additions and 3 deletions

View File

@ -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');