DeluxeSocial

The Responsive Deluxe DeluxeSocial class.

Defined (1)

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

/inc/deluxe-social.php  
  1. class DeluxeSocial extends WP_Widget { 
  2.  
  3. function DeluxeSocial() { 
  4. $widget_ops = array('classname' => 'DeluxeSocial', 'description' => 'Deluxe Social'); 
  5. $this->WP_Widget('DeluxeSocial', 'Deluxe Social', $widget_ops); 
  6.  
  7. function update($new_instance, $old_instance) { 
  8. $instance = $old_instance; 
  9. $instance['title'] = $new_instance['title']; 
  10. return $instance; 
  11.  
  12. function form($instance) { 
  13. $instance = wp_parse_args((array) $instance, array('title' => '')); 
  14. $title = $instance['title']; 
  15. ?> 
  16. <p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php _e( 'Title', 'responsive-deluxe'); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p> 
  17. <?php 
  18.  
  19. function social() { 
  20. // Output the Social Icons 
  21. $social_icons = "<ul class='deluxe-social'>"; 
  22.  
  23. $options = get_option( 'deluxe_theme_options' ); 
  24.  
  25. if ($options['fb'] !== '') { 
  26. $social_icons .= "<li><a class='deluxe-social-icon fb' href='" 
  27. . esc_url( $options['fb'] ) . 
  28. "'><i class='fa fa-facebook'></i></a></li>"; 
  29. if ($options['twitter'] !== '') { 
  30. $social_icons .= "<li><a class='deluxe-social-icon twitter' href='" 
  31. . esc_url( $options['twitter'] ) . 
  32. "'><i class='fa fa-twitter'></i></a></li>"; 
  33. if ($options['linkedin'] !== '') { 
  34. $social_icons .= "<li><a class='deluxe-social-icon linkedin' href='" 
  35. . esc_url( $options['linkedin'] ) . 
  36. "'><i class='fa fa-linkedin'></i></a></li>"; 
  37. if ($options['youtube'] !== '') { 
  38. $social_icons .= "<li><a class='deluxe-social-icon youtube' href='" 
  39. . esc_url( $options['youtube'] ) . 
  40. "'><i class='fa fa-youtube'></i></a></li>"; 
  41. if ($options['insta'] !== '') { 
  42. $social_icons .= "<li><a class='deluxe-social-icon insta' href='" 
  43. . esc_url( $options['insta'] ) . 
  44. "'><i class='fa fa-instagram'></i></a></li>"; 
  45. if ($options['tumblr'] !== '') { 
  46. $social_icons .= "<li><a class='deluxe-social-icon tumblr' href='" 
  47. . esc_url( $options['tumblr'] ) . 
  48. "'><i class='fa fa-tumblr'></i></a></li>"; 
  49. if ($options['gplus'] !== '') { 
  50. $social_icons .= "<li><a class='deluxe-social-icon gplus' href='" 
  51. . esc_url( $options['gplus'] ) . 
  52. "'><i class='fa fa-google-plus'></i></a></li>"; 
  53. if ($options['pinterest'] !== '') { 
  54. $social_icons .= "<li><a class='deluxe-social-icon pinterest' href='" 
  55. . esc_url( $options['pinterest'] ) . 
  56. "'><i class='fa fa-pinterest'></i></a></li>"; 
  57. if ($options['vimeo'] !== '') { 
  58. $social_icons .= "<li><a class='deluxe-social-icon vimeo' href='" 
  59. . esc_url( $options['vimeo'] ) . 
  60. "'><i class='fa fa-vimeo-square'></i></a></li>"; 
  61. $social_icons .= "</ul>"; 
  62.  
  63. echo $social_icons; 
  64.  
  65.  
  66. function widget($args, $instance) { 
  67. extract($args, EXTR_SKIP); 
  68.  
  69. echo $before_widget; 
  70. $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']); 
  71.  
  72. if (!empty($title)) 
  73. echo $before_title . $title . $after_title;; 
  74.  
  75. // Output the widget content here 
  76. $this->social(); 
  77. echo $after_widget; 
  78.