Filters – team_grid_filter_social

You can filter social link for team member as following

add_filter('team_grid_filter_social',  'team_grid_filter_social_extra' );

function team_grid_filter_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;			
    
  }

Displaying as text links

function team_grid_filter_social_extra(){

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

  //var_dump($team_member_social_links);

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

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

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

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

        endif;



    }

}

add_filter('team_grid_filter_social','team_grid_filter_social_extra');

 

Default social input fields are follows

  • mobile
  • website
  • email
  • skype
  • facebook
  • twitter
  • googleplus
  • pinterest
  • linkedin
  • vimeo
  • instagram