From 0fcb84d9c1a1c6d48063135f28780099dff039c8 Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 24 Apr 2012 14:41:23 +0000 Subject: [PATCH] Fix a notice in [20565] where get_the_author_meta() may be called prior to postdata from being set up. In this case, the function should return nothing (via the filter). props johnjamesjacoby. fixes #20529. see #20285. git-svn-id: http://svn.automattic.com/wordpress/trunk@20575 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/author-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php index 801dce9a2..48db8f925 100644 --- a/wp-includes/author-template.php +++ b/wp-includes/author-template.php @@ -99,7 +99,7 @@ function the_modified_author() { function get_the_author_meta( $field = '', $user_id = false ) { if ( ! $user_id ) { global $authordata; - $user_id = $authordata->ID; + $user_id = isset( $authordata->ID ) ? $authordata->ID : 0; } else { $authordata = get_userdata( $user_id ); }