mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-21 14:05:11 +00:00
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:
parent
5fc07fcd15
commit
666bfd2d91
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user