catchresponsive_get_social_icons

Generate social icons.

Description

catchresponsive_get_social_icons(); 

Usage

  1. if ( !function_exists( 'catchresponsive_get_social_icons' ) ) { 
  2. require_once '/inc/catchresponsive-social-icons.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = catchresponsive_get_social_icons(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/catchresponsive-social-icons.php  
  1. function catchresponsive_get_social_icons() { 
  2. if ( ( !$output = get_transient( 'catchresponsive_social_icons' ) ) ) { 
  3. $output = ''; 
  4.  
  5. $options = catchresponsive_get_theme_options(); // Get options 
  6.  
  7. //Pre defined Social Icons Link Start 
  8. $pre_def_social_icons = catchresponsive_get_social_icons_list(); 
  9.  
  10. foreach ( $pre_def_social_icons as $key => $item ) { 
  11. if ( isset( $options[ $key ] ) && '' != $options[ $key ] ) { 
  12. $value = $options[ $key ]; 
  13.  
  14. if ( 'email_link' == $key ) { 
  15. $output .= '<a class="genericon_parent genericon genericon-'. sanitize_key( $item['genericon_class'] ) .'" target="_blank" title="'. esc_attr__( 'Email', 'catch-responsive') . '" href="mailto:'. antispambot( sanitize_email( $value ) ) .'"><span class="screen-reader-text">'. __( 'Email', 'catch-responsive') . '</span> </a>'; 
  16. elseif ( 'skype_link' == $key ) { 
  17. $output .= '<a class="genericon_parent genericon genericon-'. sanitize_key( $item['genericon_class'] ) .'" target="_blank" title="'. esc_attr( $item['label'] ) . '" href="'. esc_attr( $value ) .'"><span class="screen-reader-text">'. esc_attr( $item['label'] ). '</span> </a>'; 
  18. elseif ( 'phone_link' == $key || 'handset_link' == $key ) { 
  19. $output .= '<a class="genericon_parent genericon genericon-'. sanitize_key( $item['genericon_class'] ) .'" target="_blank" title="'. esc_attr( $item['label'] ) . '" href="tel:' . preg_replace( '/\s+/', '', esc_attr( $value ) ) . '"><span class="screen-reader-text">'. esc_attr( $item['label'] ) . '</span> </a>'; 
  20. else { 
  21. $output .= '<a class="genericon_parent genericon genericon-'. sanitize_key( $item['genericon_class'] ) .'" target="_blank" title="'. esc_attr( $item['label'] ) .'" href="'. esc_url( $value ) .'"><span class="screen-reader-text">'. esc_attr( $item['label'] ) .'</span> </a>'; 
  22. //Pre defined Social Icons Link End 
  23.  
  24. //Custom Social Icons Link End 
  25. set_transient( 'catchresponsive_social_icons', $output, 86940 ); 
  26.  
  27. return $output; 
  28. } // catchresponsive_get_social_icons