[wp-trac] [WordPress Trac] #56229: Attempt to read property "user_nicename" on bool in link-template.php on line 265
WordPress Trac
noreply at wordpress.org
Sat Aug 27 22:41:32 UTC 2022
#56229: Attempt to read property "user_nicename" on bool in link-template.php on
line 265
--------------------------+------------------------------
Reporter: psimatrix | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Permalinks | Version: 6.0
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by sabernhardt):
Thanks for the report and for the patch!
Plugins can replace the `get_userdata` function (and/or `get_user_by`). In
case the custom function returns an unexpected type, could checking
whether `$authordata` is an object be a better condition?
{{{
if ( is_object( $authordata ) ) {
$author = $authordata->user_nicename;
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56229#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list