Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Add the new contact methods and remove not used
- */
- function my_new_profile_contact_fields( $contactmethods ) {
- // Add
- $contactmethods['twitter'] = 'Twitter <span class="description">(username)</span>';
- $contactmethods['facebook'] = 'Facebook <span class="description">(username)</span>';
- $contactmethods['lnkin'] = 'LinkedIn <span class="description">(profile URL)</span>';
- $contactmethods['gplus'] = 'Google+ <span class="description">(profile URL)</span>';
- // Remove
- unset($contactmethods['yim']);
- unset($contactmethods['aim']);
- return $contactmethods;
- }
- add_filter('user_contactmethods','my_new_profile_contact_fields', 20, 1);
- /**
- * Displaying custom user fields inside tooltip
- */
- function my_avatar_tooltip_content_user( $content_user, $user ) {
- $content_user = ''; // reset content
- $content_user .= '<div class="container-section container-user-description">';
- if ( $bio = get_the_author_meta( 'description', $user->ID ) )
- {
- $content_user .= wp_kses_post( $bio ). '<br />';
- }
- $content_user .= '<ul class="userinfo gravatar-info-services">';
- $content_user .= '<li><a href="'. esc_url( get_author_posts_url( $user->ID ) ) .'" style="float: left;margin-right: 10px">'. esc_html( __('Recent Posts') ) .'</a></li>';
- if ( $twitter = get_the_author_meta( 'twitter', $user->ID ) )
- {
- $content_user .= '<li><a href="http://www.twitter.com/'. esc_attr( $twitter ).'" class="img accounts_twitter" title="twitter" target="_blank"> </a></li>';
- }
- if ( $facebook = get_the_author_meta( 'facebook', $user->ID ) )
- {
- $content_user .= '<li><a href="http://www.facebook.com/'. esc_attr( $facebook ).'" class="img accounts_facebook" title="facebook" target="_blank"> </a></li>';
- }
- if ( $linkedin = get_the_author_meta( 'lnkin', $user->ID ) )
- {
- $content_user .= '<li><a href="'. esc_url( $linkedin ) .'" class="img accounts_linkedin" title="'. 'linkedin' .'" target="_blank" rel="nofollow"> </a>';
- }
- if ( $google = get_the_author_meta( 'gplus', $user->ID ) )
- {
- $content_user .= '<li><a href="'. esc_url( $google ) .'" class="img accounts_google" title="'. 'google+' .'" target="_blank" rel="nofollow"> </a>';
- }
- $content_user .= '</ul>';
- $content_user .= '</div>';
- return $content_user;
- }
- add_filter('axe_avatar_tooltip_content_user', 'my_avatar_tooltip_content_user', 10, 2);
- // Then, empty text from Gravatar
- function my_avatar_tooltip_content_gravatar( $content_grav, $posted_md5email, $grav_profile ) {
- $content_grav = ''; // comment this line to show also Gravatar content
- return $content_grav;
- }
- add_filter('axe_avatar_tooltip_content_gravatar', 'my_avatar_tooltip_content_gravatar', 10, 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement