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

Add support for user queries #12

Merged
merged 3 commits into from Aug 6, 2018
Merged

Conversation

acobster
Copy link
Contributor

Thanks for this awesome plugin!

This adds support for querying users by their lat/lng data. The public interface is exactly the same, but because WP_User_Query internals don't use a specific clause-based hook like posts_clauses, I defined a new hook in activate and replaced each clause one by one. The new implementation lives in Birgir\Geo\GeoQueryUserHaversine.

@acobster
Copy link
Contributor Author

Hmmm. Having trouble replicating that failure locally in my VVV setup.

vagrant@vvv (master *) .../conifer/wp/wp-content/plugins/geo-query $ phpunit
Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

.......                                                             7 / 7 (100%)

Time: 1.74 seconds, Memory: 24.00MB

OK (7 tests, 17 assertions)
vagrant@vvv (master *) .../conifer/wp/wp-content/plugins/geo-query $ WP_MULTISITE=1 phpunit
Installing...
Installing network...
Running as multisite...
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

.......                                                             7 / 7 (100%)

Time: 1.95 seconds, Memory: 24.00MB

OK (7 tests, 17 assertions)
vagrant@vvv (master *) .../conifer/wp/wp-content/plugins/geo-query $ php -v
PHP 7.0.30-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: May  2 2018 13:00:43) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.30-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
vagrant@vvv (master *) .../conifer/wp/wp-content/plugins/geo-query $ wp core version
4.9.7

Any ideas?

@birgire
Copy link
Owner

birgire commented Jul 25, 2018

Hey @acobster that's awesome, thank you for your contribution.

I'm out of town in July and early August and can't test it at the moment, but I look forward to test when I get back.

Thanks again.

@birgire birgire merged commit 5ec354b into birgire:master Aug 6, 2018
birgire added a commit that referenced this pull request Aug 6, 2018
@birgire
Copy link
Owner

birgire commented Aug 6, 2018

The changes went through the integration tests successfully on my install too.

The Travis checks did not install it via Composer so I added the new class to the fallback for those how are not using Composer. I thought that would solve it, but still some Travis issues.

So I merged it and I will look into the Travis issue in another ticket.

Thank you @acobster

@birgire birgire mentioned this pull request Aug 6, 2018
@acobster
Copy link
Contributor Author

acobster commented Aug 6, 2018

Awesome, thanks!

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.

None yet

2 participants