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

geo_mashup_query doesn't work with WP_User_Query #810

Open
apolinario opened this issue Apr 27, 2018 · 1 comment
Open

geo_mashup_query doesn't work with WP_User_Query #810

apolinario opened this issue Apr 27, 2018 · 1 comment

Comments

@apolinario
Copy link

apolinario commented Apr 27, 2018

I don't know if this is a bug or a feature request but in my use case I need to list all WordPress users within a radius, but the geo_mashup_query function doesn't seem to work with WP_User_Query function.

This is my code, which returns all users

$args = array(
	'geo_mashup_query' => array(
		'near_lat' => $lat_user,
		'near_lng' => $long_user,
		'radius_km' => 1,
	)	
);

// The Query
$user_query = new WP_User_Query( $args );

// User Loop
if ( ! empty( $user_query->get_results() ) ) {
	foreach ( $user_query->get_results() as $user ) {
		//all users are listed here
	}
}
@cyberhobo
Copy link
Owner

That might be possible as a new feature. Your current option is the nearby list tag.

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

No branches or pull requests

2 participants