WordPress.org

Forums

Customized Search (3 posts)

  1. Skizofre3e
    Member
    Posted 2 years ago #

    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(
    		array(
    			'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.

  2. davemhui
    Member
    Posted 2 years ago #

    You can post a job at jobs.wordpress.net

  3. Aaron
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.