WP: Add extra contact methods from user info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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