Created
October 27, 2016 18:01
-
-
Save BeardedGinger/043834ae676f3bf3e3dfa9ca0ef07ff3 to your computer and use it in GitHub Desktop.
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
<?php | |
add_filter( 'user_contactmethods', 'limecuda_public_yoast_contactmethods', 20, 1 ); | |
/** | |
* If you're using the Yoast SEO plugin, there are contact methods available on user profiles | |
* to add Facebook, Twitter, and Google+ information for the user. | |
* | |
* However, with the way they are added, they're only available within the admin. So, | |
* if you're trying to create an author template which automatically pulls all the registered | |
* contact methods, these Yoast methods will not be returned. | |
* | |
* This function will make these contact methods available to wp_get_user_contact_methods(). | |
* | |
* @param array $methods The registered contact methods. | |
*/ | |
function limecuda_public_yoast_contactmethods( $methods ) { | |
if ( ! function_exists( 'wpseo_init' ) ) | |
return $methods; | |
$methods['googleplus'] = __( 'Google+', 'wordpress-seo' ); | |
$methods['twitter'] = __( 'Twitter username (without @)', 'wordpress-seo' ); | |
$methods['facebook'] = __( 'Facebook profile URL', 'wordpress-seo' ); | |
return $methods; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment