Support » Fixing WordPress » Customized Search

  • Goodmorning,
    I’m looking for where to put this code :

    function get_users_by_meta_data( $meta_key, $meta_value ) {
    	// Query for users based on the meta data
    	$user_query = new WP_User_Query(
    			'meta_key'	  =>	$meta_key,
    			'meta_value'	=>	$meta_value
    	// Get the results from the query, returning the first user
    	$users = $user_query->get_results();
    	return $users;
    } // end get_users_by_meta_data

    So what this function actually does is returning the users having specific meta keys and values.
    but I don’t know how to integrate this function into my wordpress portal.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can post a job at

    I am assuming they want you to enter this into your functions page.

    Appearance > Editor

    Select functions.php on the right side and paste that in at the very bottom. If you have a


    tag at the very bottom then paste above that.

    *note if you mess up functions.php you can white screen yourself out of your site and only recoverable through FTP. So make sure you know what you are doing when messing with this file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customized Search’ is closed to new replies.