fahimmurshed

Themeum Social Code

Jan 17th, 2019 (edited)
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.15 KB | None | 0 0
  1. <?php
  2. add_shortcode( 'themeum_social_button', function($atts, $content = null) {
  3.  
  4.     extract(shortcode_atts(array(
  5.         'title'             => '',
  6.         'facebook'          => '',
  7.         'facebook_text'     => '',
  8.         'twitter'           => '',
  9.         'twitter_text'      => '',
  10.         'youtube'           => '',
  11.         'youtube_text'      => '',
  12.         'gplus'             => '',
  13.         'gplus_text'        => '',
  14.         'linkedin'          => '',
  15.         'linkedin_text'     => '',
  16.         'delicious'         => '',
  17.         'delicious_text'    => '',
  18.         'tumblr'            => '',
  19.         'tumblr_text'       => '',
  20.         'stumbleupon'       => '',
  21.         'stumbleupon_text'  => '',
  22.         'pinterest'         => '',
  23.         'pinterest_text'    => '',
  24.         'dribble'           => '',
  25.         'dribble_text'      => '',
  26.         'class'             => '',
  27.         ), $atts));
  28.  
  29.     $inline_css = $output = '';
  30.  
  31.  
  32.     $output .= '<div class="themeum-social-button'.esc_attr($class).'">';
  33.     $output .= '<ul class="list-unstyled">';
  34.     if( $facebook ) {
  35.     $output .= '<li><a href="'.esc_url($facebook).'" target="_blank"><i class="fa fa-facebook-square"></i>'.esc_html($facebook_text).'</a></li>';
  36.     }                
  37.     if( $twitter ) {
  38.     $output .= '<li><a href="'.esc_url($twitter).'" target="_blank"><i class="fa fa-twitter-square"></i>'.esc_html($twitter_text).'</a></li>';
  39.     }
  40.     if( $youtube ) {
  41.     $output .= '<li><a href="'.esc_url($youtube).'" target="_blank"><i class="fa fa-youtube-square"></i>'.esc_html($youtube_text).'</a></li>';
  42.     }
  43.     if( $gplus ) {
  44.     $output .= '<li><a href="'.esc_url($gplus).'" target="_blank"><i class="fa fa-google-plus-square"></i>'.esc_html($gplus_text).'</a></li>';
  45.     }              
  46.     if( $linkedin ) {
  47.     $output .= '<li><a href="'.esc_url($linkedin).'" target="_blank"><i class="fa fa-linkedin-square"></i>'.esc_html($linkedin_text).'</a></li>';
  48.     }              
  49.     if( $delicious ) {
  50.     $output .= '<li><a href="'.esc_url($delicious).'" target="_blank"><i class="fa fa-delicious"></i>'.esc_html($delicious_text).'</a></li>';
  51.     }              
  52.     if( $tumblr ) {
  53.     $output .= '<li><a href="'.esc_url($tumblr).'" target="_blank"><i class="fa fa-tumblr-square"></i>'.esc_html($delicious_text).'</a></li>';
  54.     }              
  55.     if( $stumbleupon ) {
  56.     $output .= '<li><a href="'.esc_url($stumbleupon).'" target="_blank"><i class="fa fa-stumbleupon-circle"></i>'.esc_html($stumbleupon_text).'</a></li>';
  57.     }              
  58.     if( $pinterest ) {
  59.     $output .= '<li><a href="'.esc_url($pinterest).'" target="_blank"><i class="fa fa-pinterest-square"></i>'.esc_html($pinterest_text).'</a></li>';
  60.     }              
  61.     if( $dribble ) {
  62.     $output .= '<li><a href="'.esc_url($dribble).'" target="_blank"><i class="fa fa-dribbble"></i>'.esc_html($dribble_text).'</a></li>';
  63.     }
  64.     $output .= '</ul>';
  65.     $output .= '</div>';
  66.  
  67.     return $output;
  68.  
  69. });
  70.  
  71.  
  72. //Visual Composer
  73. if (class_exists('WPBakeryVisualComposerAbstract')) {
  74. vc_map(array(
  75.     "name" => __("Social Button", "themeum"),
  76.     "base" => "themeum_social_button",
  77.     'icon' => 'icon-thm-social-button',
  78.     "class" => "",
  79.     "description" => __("Widget Title Heading", "themeum"),
  80.     "category" => __('Themeum', "themeum"),
  81.     "params" => array(         
  82.  
  83.         array(
  84.             "type" => "textfield",
  85.             "heading" => __("Title", "themeum"),
  86.             "param_name" => "title",
  87.             "value" => "",
  88.             ), 
  89.  
  90.         array(
  91.             "type" => "textfield",
  92.             "heading" => __("Facebook URL", "themeum"),
  93.             "param_name" => "facebook",
  94.             "value" => "",
  95.             ), 
  96.  
  97.         array(
  98.             "type" => "textfield",
  99.             "heading" => __("Like us on Facebook", "themeum"),
  100.             "param_name" => "facebook_text",
  101.             "value" => "",
  102.             ),     
  103.  
  104.         array(
  105.             "type" => "textfield",
  106.             "heading" => __("Twitter URL", "themeum"),
  107.             "param_name" => "twitter",
  108.             "value" => "",
  109.             ), 
  110.  
  111.         array(
  112.             "type" => "textfield",
  113.             "heading" => __("Follow us on Twitter", "themeum"),
  114.             "param_name" => "twitter_text",
  115.             "value" => "",
  116.             ),
  117.         array(
  118.             "type" => "textfield",
  119.             "heading" => __("Youtube URL", "themeum"),
  120.             "param_name" => "youtube",
  121.             "value" => "",
  122.             ),
  123.  
  124.         array(
  125.             "type" => "textfield",
  126.             "heading" => __("Subscribe us on Youtube", "themeum"),
  127.             "param_name" => "youtube_text",
  128.             "value" => "",
  129.             ),
  130.  
  131.         array(
  132.             "type" => "textfield",
  133.             "heading" => __("Gplus URL", "themeum"),
  134.             "param_name" => "gplus",
  135.             "value" => "",
  136.             ), 
  137.  
  138.         array(
  139.             "type" => "textfield",
  140.             "heading" => __("Follow us on Gplus", "themeum"),
  141.             "param_name" => "gplus_text",
  142.             "value" => "",
  143.             ), 
  144.  
  145.         array(
  146.             "type" => "textfield",
  147.             "heading" => __("Linkedin URL", "themeum"),
  148.             "param_name" => "linkedin",
  149.             "value" => "",
  150.             ),
  151.  
  152.         array(
  153.             "type" => "textfield",
  154.             "heading" => __("Follow us on Linkedin", "themeum"),
  155.             "param_name" => "linkedin_text",
  156.             "value" => "",
  157.             ),                 
  158.  
  159.         array(
  160.             "type" => "textfield",
  161.             "heading" => __("Pinterest URL", "themeum"),
  162.             "param_name" => "pinterest",
  163.             "value" => "",
  164.             ),
  165.  
  166.         array(
  167.             "type" => "textfield",
  168.             "heading" => __("Follow us on Pinterest", "themeum"),
  169.             "param_name" => "pinterest_text",
  170.             "value" => "",
  171.             ), 
  172.  
  173.         array(
  174.             "type" => "textfield",
  175.             "heading" => __("Delicious URL", "themeum"),
  176.             "param_name" => "delicious",
  177.             "value" => "",
  178.             ),     
  179.  
  180.         array(
  181.             "type" => "textfield",
  182.             "heading" => __("Follow us on Delicious", "themeum"),
  183.             "param_name" => "delicious_text",
  184.             "value" => "",
  185.             ), 
  186.  
  187.         array(
  188.             "type" => "textfield",
  189.             "heading" => __("Tumblr URL", "themeum"),
  190.             "param_name" => "tumblr",
  191.             "value" => "",
  192.             ),     
  193.  
  194.         array(
  195.             "type" => "textfield",
  196.             "heading" => __("Follow us on Tumblr", "themeum"),
  197.             "param_name" => "tumblr_text",
  198.             "value" => "",
  199.             ), 
  200.  
  201.         array(
  202.             "type" => "textfield",
  203.             "heading" => __("Stumbleupon URL", "themeum"),
  204.             "param_name" => "stumbleupon",
  205.             "value" => "",
  206.             ),         
  207.  
  208.         array(
  209.             "type" => "textfield",
  210.             "heading" => __("Follow us on Stumbleupon", "themeum"),
  211.             "param_name" => "stumbleupon_text",
  212.             "value" => "",
  213.             ), 
  214.  
  215.         array(
  216.             "type" => "textfield",
  217.             "heading" => __("Dribble URL", "themeum"),
  218.             "param_name" => "dribble",
  219.             "value" => "",
  220.             ),     
  221.  
  222.         array(
  223.             "type" => "textfield",
  224.             "heading" => __("Follow us on Dribble", "themeum"),
  225.             "param_name" => "dribble_text",
  226.             "value" => "",
  227.             ),
  228.  
  229.         array(
  230.             "type" => "textfield",
  231.             "heading" => __("Custom Class ", "themeum"),
  232.             "param_name" => "class",
  233.             "value" => "",
  234.             ),
  235.  
  236.         )
  237.     ));
  238. }
Add Comment
Please, Sign In to add comment