Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Don't check is_user_member_of_blog(), native WP doesn't #133

wants to merge 1 commit into from

Conversation

misterbisson
Copy link

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.

Conform to native WP behavior, don't check `is_user_member_of_blog()` on authors attached to a post.
@danielbachhuber
Copy link
Contributor

This fixes problems where users have been removed from a blog, but remain as authors of posts in it.

@misterbisson Just to confirm, you'd like those users to remain authors of the posts?

@misterbisson
Copy link
Author

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 is_user_member_of_blog() before returning, which causes trouble.

@danielbachhuber
Copy link
Contributor

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.

@misterbisson
Copy link
Author

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 WP_Query to 404.

@danielbachhuber
Copy link
Contributor

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.

@misterbisson
Copy link
Author

Addendum to my last: we're on that part. Should have a fix shortly.

@misterbisson
Copy link
Author

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.

@misterbisson
Copy link
Author

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.

@danielbachhuber
Copy link
Contributor

We should follow core's new behavior: https://core.trac.wordpress.org/changeset/27290

@misterbisson want to finish this up?

@misterbisson
Copy link
Author

Huh, that's actually a breaking change in core for us now. Or, it could be. I need to test.

@danielbachhuber danielbachhuber modified the milestones: 3.1, next Feb 28, 2014
@danielbachhuber
Copy link
Contributor

I changed this behavior with tests in #179. Would be interested to hear your feedback on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants