Automattic / Co-Authors-Plus

Multiple bylines and Guest Authors for WordPress
https://wordpress.org/plugins/co-authors-plus/
GNU General Public License v2.0
291 stars 205 forks source link

Ensure 'nickname' is created to prevent is_author() PHP notice with Guest Author #939

Closed srtfisher closed 1 year ago

srtfisher commented 1 year ago

Ensure nickname is created on the object to prevent an issue with nickname not existing on the Guest Author's object: https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-query.php#L4087

GaryJones commented 1 year ago

Thanks Sean!

Would it make more sense just to set it as an empty string anyway, regardless of the population of the display name?

srtfisher commented 1 year ago

@GaryJones sounds good to me, made that change

GaryJones commented 1 year ago

Thanks @srtfisher.

In what context (admin page? another request?, etc.) were you seeing the PHP Warning? (so I can reproduce it before applying the patch).

srtfisher commented 1 year ago

I'm seeing this crop up a lot when using is_author( 'name' ) on a guest author feed. the name argument is required to get the notice.