Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Busqueda Usuarios Personalizada

// WP_User_Query arguments
$args = array(
	'search_columns' => array( 'numero_cliente' ),
	'meta_query'     => array(
		array(
			'key'     => 'numero_cliente',
			'value'   => 'searchString',
		),
	),
	'fields'         => array( 'numero_cliente' ),
);

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

// The User Loop
if ( ! empty( $user_query->results ) ) {
	foreach ( $user_query->results as $user ) {
		// do something
	}
} else {
	// no users found
}