Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

How to retrieve WP user profile fields along with custom Types user fields?

$
0
0

I'm trying to assemble a neighborhood contact directory from the subscribers of the site. I've created two custom user fields with Types (house number and street name) but also need to retrieve the first name, last name, and email that is already part of the WordPress user profile. I then want to use Views to assemble a contact directory that is in a table format, for instance.

<first name> | <last name> | <house number> + <street name> | <phone> | <email>

Additionally, I'm using some code in my functions.php file to add a phone number field to the Contact Info group that contains the email address. See below. I would like to know if I could also retrieve this value. The reason I'm not using Types for this is because I can conveniently pair this with the email in the Contact Info section because of this specific function.

function modify_contact_methods($profile_fields) {

	// Add new fields
	$profile_fields['phone'] = 'Primary Phone';

	return $profile_fields;

}
add_filter('user_contactmethods', 'modify_contact_methods');

How can I then retrieve the WordPress values to then use them in a Views Content Template?


Viewing all articles
Browse latest Browse all 20145

Trending Articles