Skip to content

BUG: WP_User_Query Search returns all user when search_columns set to user_url #61

@burhandodhy

Description

@burhandodhy

When we set the search_columns to user_url in the WP_User_Query. The search result returns all the user whose website value is set.

Steps to Reproduce

  1. Create 3 users.
  2. Set the Website field of one user to https://elasticpress.io and for other 2 users set field to https://example.com
  3. Run the below snippet
add_action( 'init', function() : void {

	$user_query = new \WP_User_Query(
			[
				'ep_integrate' => true,
				'search'        => 'https://elasticpress.io',
				'search_columns' => [ 'user_url' ],
			]
		);

	var_dump( $user_query->results );

}  );

Expected behavior

It should only returns the user who's website field is https://elasticpress.io

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions