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
This commit is contained in:
parent
aec52638b1
commit
22147bfbfb
@ -136,11 +136,11 @@ function get_permalink( $id = 0, $leavename = false ) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( $post->post_type == 'page' )
|
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' )
|
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) ) ) )
|
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');
|
$permalink = get_option('permalink_structure');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user