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
This commit is contained in:
nacin 2012-04-24 14:41:23 +00:00
parent 300ea7891d
commit 0fcb84d9c1
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ function the_modified_author() {
function get_the_author_meta( $field = '', $user_id = false ) { function get_the_author_meta( $field = '', $user_id = false ) {
if ( ! $user_id ) { if ( ! $user_id ) {
global $authordata; global $authordata;
$user_id = $authordata->ID; $user_id = isset( $authordata->ID ) ? $authordata->ID : 0;
} else { } else {
$authordata = get_userdata( $user_id ); $authordata = get_userdata( $user_id );
} }