From ba8c7d12bae24c37ea5f80a252436fb2c0af2654 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 28 Aug 2007 18:58:54 +0000 Subject: [PATCH] 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 --- wp-includes/link-template.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 0b4c439897..ac5c31c011 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -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')