Skip to content

Instantly share code, notes, and snippets.

@Steven-Rose
Created February 23, 2012 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Steven-Rose/1895294 to your computer and use it in GitHub Desktop.
Save Steven-Rose/1895294 to your computer and use it in GitHub Desktop.
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);
Author.php
==========
$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