Filters – team_filter_team_member_social

You can filter social link for team member as following

add_filter('team_filter_team_member_social',  'team_filter_team_member_social_extra' );

function team_filter_team_member_social_extra($social){

    $social_new = '';
    $new_twitter = get_post_meta(get_the_ID(),'new_twitter', true);
    
    if(!empty($new_twitter)){
      
      $social_new.= '<span  class="new-twitter" >
              <a target="_blank" href="'.$new_twitter.'"> </a>
              </span>';    
      
      }

            
            
    return $social.$social_new;            
    
  }

Replacing with new

add_filter('team_filter_team_member_social',  'team_grid_filter_social_extra' );

function team_grid_filter_social_extra($social_html){

  if(is_singular('team_member')){
    
    $team_member_social_links = get_post_meta(get_the_ID(),'team_member_social_links',true);
    
    $team_member_email = $team_member_social_links['email'];
  
    return '<p><a href="mailto:'.$team_member_email.'">'.$team_member_email.'</a></p>';
    
    }


  }

 

Displaying as text links

function team_grid_filter_social_extra($html){

    if( is_singular('team_member')){

      $team_member_social_links = get_post_meta( get_the_ID(), 'team_member_social_links', true );

      foreach ($team_member_social_links as $link_key=>$link){

        if(!empty($link)):
          if($link_key=='mobile'){
            $html.= '<a href="tell:'.$link.'">'.$link.'</a> ';
          }
                elseif($link_key=='website'){
            $html.= '<a href="'.$link.'">'.$link.'</a> ';
          }
                elseif($link_key=='email'){
            $html.= '<a href="mailto:'.$link.'">'.$link.'</a> ';
          }
                elseif($link_key=='skype'){
            $html.= '<a href="skype:'.$link.'">'.$link.'</a> ';
          }

                elseif($link_key=='facebook'){
            $html.= '<a href="'.$link.'">Facebook</a> ';
          }

                elseif($link_key=='twitter'){
            $html.= '<a href="'.$link.'">Twitter</a> ';
          }
        endif;

      }

      echo $html;

    }
    else{
      echo $html;
    }




}

add_filter('team_grid_filter_social','team_grid_filter_social_extra');

Displaying as image icon

function team_grid_filter_social_extra($html_social){

    if( is_singular('team_member')){

      $team_member_social_links = get_post_meta( get_the_ID(), 'team_member_social_links', true );
      $team_member_social_field = get_option( 'team_member_social_field' );


      $html_social.= '<div class="team-container"><div class="team-social"> ';

      foreach ($team_member_social_field as $field_key=>$field_info) {

        $visibility = $field_info['visibility'];
        $name = $field_info['name'];

        if(!empty($field_key) && !empty($team_member_social_links[$field_key]) && !empty($field_info['visibility'])){

          if(!empty($team_member_social_field[$field_key]['icon']))
          {
            $icon_bg = 'style="background-image:url('.$team_member_social_field[$field_key]['icon'].')"';
          }
          else
          {
            $icon_bg = '';
          }




                if($field_key == 'website'){

                  //var_dump('Hello 1');

                    $html_social.= '<span '.$icon_bg.' class="website">
                                <a target="_blank" href="'.$team_member_social_links[$field_key].'"></a>
                            </span>';
                }
                elseif($field_key == 'email'){

                    $html_social.= '<span '.$icon_bg.' class="email">
                                <a href="mailto:'.$team_member_social_links[$field_key].'"></a>
                            </span>';
                }

                elseif($field_key == 'skype'){

                    $html_social.= '<span '.$icon_bg.' class="skype">
                                <a  title="'.$field_key.'" href="skype:'.$team_member_social_links[$field_key].'"></a>
                            </span>';
                }

                elseif($field_key == 'mobile'){

                    $html_social.= '<span '.$icon_bg.' class="mobile">
                                <a  title="'.$field_key.'" href="tel:'.$team_member_social_links[$field_key].'"></a>
                            </span>';
                }


                elseif($field_key == 'phone'){

                    $html_social.= '<span '.$icon_bg.' class="mobile">
                                <a  title="'.$field_key.'" href="tel:'.$team_member_social_links[$field_key].'"></a>
                            </span>';
                }


                else{
                    $html_social.= '<span '.$icon_bg.' class="'.$field_key.'" >
                                <a target="_blank" href="'.$team_member_social_links[$field_key].'"> </a>
                            </span>';
                }




        }
      }
      $html_social.= '</div> </div>';


      echo $html_social;

    }
    else{
      echo $html_social;
    }




}

add_filter('team_grid_filter_social','team_grid_filter_social_extra');