Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP warning when post has no author #1066

Open
peterhassett opened this issue Oct 19, 2024 · 0 comments
Open

PHP warning when post has no author #1066

peterhassett opened this issue Oct 19, 2024 · 0 comments

Comments

@peterhassett
Copy link

This is an edge case.

If a post (or attachment) has no post_author value, when an end-user loads its front-end page, a PHP warning is fired:

Message PHP Warning: Attempt to read property "user_login" on null in /srv/htdocs/wp-content/plugins/co-authors-plus/template-tags.php on line 129
Timestamp 2024-10-19T18:44:40.000Z
Kind plugins
Name co-authors-plus
File /srv/htdocs/wp-content/plugins/co-authors-plus/template-tags.php
Line 129

Specifically, I think it's this bit: $author_text = $i->current_author->user_login;, wherein the current_author is null.

I suppose posts without authors is technically invalid, but I figured I'd at least raise the issue here, just in case. This cause/d our site to fire a ton of errors -- many a minute -- filling up our logs.

Thank you!

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

No branches or pull requests

2 participants