Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WP: Add extra contact methods from user info
function add_contact_methods( $contactmethods ) {
// Add Google Profiles
$contactmethods['google_profile'] = 'Google Profile URL';
return $contactmethods;
add_filter( 'user_contactmethods', 'add_contact_methods', 10, 1);
$google_profile = get_the_author_meta( 'google_profile' );
if ( $google_profile ) {
echo '<a href="' . esc_url($google_profile) . '" rel="me">Google Profile</a>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment