Don't return permalink for non-existent post. Props Viper007Bond. fixes #4834
git-svn-id: https://develop.svn.wordpress.org/trunk@5956 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
69ae82a3fd
commit
ba8c7d12ba
|
@ -60,6 +60,9 @@ function get_permalink($id = 0) {
|
||||||
);
|
);
|
||||||
|
|
||||||
$post = &get_post($id);
|
$post = &get_post($id);
|
||||||
|
|
||||||
|
if ( empty($post->ID) ) return FALSE;
|
||||||
|
|
||||||
if ( $post->post_type == 'page' )
|
if ( $post->post_type == 'page' )
|
||||||
return get_page_link($post->ID);
|
return get_page_link($post->ID);
|
||||||
elseif ($post->post_type == 'attachment')
|
elseif ($post->post_type == 'attachment')
|
||||||
|
|
Loading…
Reference in New Issue