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
This commit is contained in:
parent
3aaa209968
commit
a89d307726
@ -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 );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user