Co-Authors-Plus icon indicating copy to clipboard operation
Co-Authors-Plus copied to clipboard

fix: only shows authors in the Link user dropdown

Open leogermani opened this issue 1 year ago • 2 comments

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.

leogermani avatar Jul 04 '23 15:07 leogermani

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.

GaryJones avatar Jul 22 '23 21:07 GaryJones

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.

GaryJones avatar Aug 25 '23 15:08 GaryJones