Co-Authors-Plus
Co-Authors-Plus copied to clipboard
fix: only shows authors in the Link user dropdown
Description
This is a PR / question.
We have had issues with the "Link user" dropdown, under the "Unique slug" metabox when editing a Guest Author.
When a site has thousands of subscribers, the dropdown gets too big and it causes the browser to crash.
We have worked around this issue via the provided filter, but I was wondering if this makes sense to be the default behavior, as chances are that we will want to link a Guest Author to a WP author, and not a subscriber or a user without rights to write a post.
Related/similiar PR -> https://github.com/Automattic/Co-Authors-Plus/pull/872
Deploy Notes
No
Steps to Test
- Create a site with thousands of subscribers (like 200,000).
- Edit a Guest Author
- You should see the dropdown causing the page to halt and maybe the browser to crash
Checkout this PR and see that the page works fine and only users with edit_posts cap are displayed.
Not fully checked, but if the code does what I think it does, that looks sensible. This would be a bit of a breaking change (in behaviour), though, so I would suggest saving it for a minor (not point) release.
as chances are that we will want to link a Guest Author to a WP author, and not a subscriber or a user without rights to write a post
I guess there could be a case when creating a Guest Author linked to a Subscriber is exactly the use case for someone - that they don't want to give a Subscriber any higher role, but do want to be able to mark them as a co-author on a post.