-
Notifications
You must be signed in to change notification settings - Fork 206
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
Don't check is_user_member_of_blog(), native WP doesn't #133
Don't check is_user_member_of_blog(), native WP doesn't #133
Conversation
Conform to native WP behavior, don't check `is_user_member_of_blog()` on authors attached to a post.
@misterbisson Just to confirm, you'd like those users to remain authors of the posts? |
Correct. Use case is to remove a user from the blog to remove their permissions for that blog, without having to reassign authorship of their posts (or letting it break as it does now). Native WP behavior works pretty well for this, but Co-Authors-Plus checks |
Ok. Here's the original context for the change: f78e9ba The problem was that you could go to techcrunch.com/author/photomatt/ and see Matt's contact info because get_coauthor_by() was being used to filter whether it was a valid user or not. So we need some code to make sure the author has published posts on the site before reverting the behavior. Or we can slap a filter on it so it can be controlled on a site-by-site basis. |
Actually, I may have a fix for that too. We rewrote the query filters, though we implemented them as part of a separate plugin. Basically, we remove all the query filters from Co-Authors-Plus and replace them with some new request parsing that turns them into real taxonomy queries: https://github.com/GigaOM/go-local-coauthors-plus/blob/master/components/class-go-local-coauthors-plus-query.php . Right now it just gives up filtering if the author name is invalid, but that's easy enough to fix and cause the whole |
I'd be down to take a look, although I'm afraid to make any changes to the query filtering without tests as my memory on smoke testing is a bit fuzzy. |
Addendum to my last: we're on that part. Should have a fix shortly. |
Understood on the concerns about changing the query filtering. We did a lot of work on it when building http://search.gigaom.com/ , but there are still some details of the author search that don't quite work right with other facets/filters. |
I meant to update this. We're struggling with that bug too, but on other properties we completely replace the queries with modern taxonomy queries. This change in that code resolved the problem. |
We should follow core's new behavior: https://core.trac.wordpress.org/changeset/27290 @misterbisson want to finish this up? |
Huh, that's actually a breaking change in core for us now. Or, it could be. I need to test. |
I changed this behavior with tests in #179. Would be interested to hear your feedback on it. |
Conform to native WP behavior, don't check
is_user_member_of_blog()
on authors attached to a post.This fixes problems where users have been removed from a blog, but remain as authors of posts in it.