Don't return permalink for non-existent post. Props Viper007Bond. fixes #4834

git-svn-id: http://svn.automattic.com/wordpress/trunk@5956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-08-28 18:58:54 +00:00
parent 5fc07fcd15
commit 666bfd2d91
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')