Fix #215 "Cannot remove the last author once post is saved"
Problem: "If you assign a co-author to a post, save it, and reload the page, the Remove link disappears. You can no longer remove that author."
Fix: Remove the comment // Hide the delete button if there's only one co-author and the two lines of code that follow. The lines in question hide the "X" button. Removing those lines means the X button stays, allowing users to remove the last author.
Makes sense to me. @danielbachhuber can you think of any reason not to do this? It seems like it's being hidden on purpose, but I'm not 100% sure why.
There's some existing functionality where you can force the use of guest authors, and default to no assigned author. I don't recall why this wasn't implemented for just straight WordPress authors, although it seems like it could cause problems with caps.
Paul, could you describe in a bit more detail what you want to do to provide context?
Personally, I think CAP really, really needs unit test coverage before we'd go about changing something like this. The codebase is quite old with lots of people using it, so changes make me nervous.
We sometimes want an article without a CoAuthor. You can create one if your WP user account is not linked to a CoAuthor.
However, if your WP user account is linked to a CoAuthor, then a CoAuthor is automatically assigned to the article, and there's no way to remove that CoAuthor.
This means sometimes staff have to ask someone else to create articles on their behalf, which is inconvenient.
This patch allows you to remove all CoAuthors from an article.
@danielbachhuber @joshbetz Can we include this fix? I received another request for it today.
I think @danielbachhuber is right that it probably needs a unit test for this first. This particular update also enables this feature for sites that may want it to continue to work as it does now. It would make more sense to me to do it as a filterable option.
A filterable option sounds good. In any case, I think the delete button should still be hidden if there are no coauthors.
@paulschreiber This script needs to be localized with the value of force_guest_authors and then this check can be disabled only in the scenario where that is false.
Closing for lack of response.