Automattic / Automattic/co-authors-plus
Prevent Infinite Loops
- Dominant language
- PHP
- Stars
- 322
- Forks
- 216
- Avg merge
- 7h 50m
- Merged PRs (30d)
- 65
Description
The following results in an infinite loop because coauthors_posts_links relies on `get_the_author` to output the user's name. We should prevent this from happening.
`
function my_guest_author($author){
if ( function_exists( 'coauthors_posts_links' ) )
$author = coauthors_posts_links();
return $author;
}
add_filter('the_author', 'my_guest_author');
`
Contributor guide
Research direction
Start by tracing the the_author filter callback and the coauthors_posts_links/get_the_author interaction shown in the report. Reproduce the recursive call, then verify that author output no longer loops while coauthor links still render.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- content
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100