Skip to content

Conversation

shakyjake
Copy link

Fix warning for when post has no author. Resolves #1066

Description

Add an is_bool check to current_author property of the CoAuthorsIterator class to prevent warning.

Deploy Notes

None

Steps to Test

None

Fix warning for when post has no author. Resolves Automattic#1066
}

// Fallback to user_login if we get something empty
if ( empty( $author_text ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ( empty( $author_text ) ) {
if ( empty( $author_text ) && is_object( $i->current_author ) && ! empty( $i->current_author->user_login ) ) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP warning when post has no author

2 participants