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:
Ryan Boren 2007-08-28 18:58:54 +00:00
parent 69ae82a3fd
commit ba8c7d12ba
1 changed files with 3 additions and 0 deletions

View File

@ -60,6 +60,9 @@ function get_permalink($id = 0) {
);
$post = &get_post($id);
if ( empty($post->ID) ) return FALSE;
if ( $post->post_type == 'page' )
return get_page_link($post->ID);
elseif ($post->post_type == 'attachment')