From a89d307726ae6a971d1b9c68aeabbc69c02220a8 Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@20575 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 801dce9a29..48db8f9253 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 ); }