/
home
/
henzagold
/
blog
/
wp-content
/
themes
/
gillion
/
inc
/
elements
/
File Upload :
llllll
Current File: /home/henzagold/blog/wp-content/themes/gillion/inc/elements/social-networks.php
<?php /* Element: Button */ class vcSocialNetworks extends WPBakeryShortCode { function __construct() { add_action( 'init', array( $this, '_mapping' ), 12 ); add_shortcode( 'vcg_social_networks', array( $this, '_html' ) ); } public function _mapping() { if ( !defined( 'WPB_VC_VERSION' ) ) { return; } vc_map( array( 'name' => __('Social Networks', 'gillion'), 'base' => 'vcg_social_networks', 'description' => __('Links to your social networks', 'gillion'), 'category' => __('Gillion Elements', 'gillion'), 'icon' => get_template_directory_uri().'/img/builder-icon.png', 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Facebook', 'gillion' ), 'param_name' => 'facebook', 'description' => __( 'Enter URL to your Facebook profile', 'gillion' ), ), array( 'type' => 'textfield', 'heading' => __( 'Twitter', 'gillion' ), 'param_name' => 'twitter', 'description' => __( 'Enter URL to your Twitter profile', 'gillion' ), ), array( 'type' => 'textfield', 'heading' => __( 'Tumblr', 'gillion' ), 'param_name' => 'tumblr', 'description' => __( 'Enter URL to your Tumblr profile', 'gillion' ), ), array( 'type' => 'textfield', 'heading' => __( 'Pinterest', 'gillion' ), 'param_name' => 'pinterest', 'description' => __( 'Enter URL to your Pinterest profile', 'gillion' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Alignment', 'gillion' ), 'param_name' => 'alignment', 'value' => array( __( 'Left', 'gillion' ) => 'left', __( 'Center', 'gillion' ) => 'center', __( 'Right', 'gillion' ) => 'right', ), 'std' => 'center', 'admin_label' => false, 'group' => __( 'Styling', 'gillion' ), ), array( 'type' => 'textfield', 'heading' => __( 'Font Size', 'gillion' ), 'param_name' => 'font_size', 'description' => __( 'Enter icon font size', 'gillion' ), 'std' => '18px', 'group' => __( 'Styling', 'gillion' ), ), array( 'type' => 'colorpicker', 'heading' => __( 'Icon Color', 'gillion' ), 'param_name' => 'icon_color', 'value' => '', 'group' => __( 'Styling', 'gillion' ), ), array( 'type' => 'css_editor', 'heading' => __( 'CSS box', 'gillion' ), 'param_name' => 'css', 'group' => __( 'Design Options', 'gillion' ), ), ), ) ); } public static function _html( $atts ) { extract( shortcode_atts( array( 'facebook' => '', 'twitter' => '', 'tumblr' => '', 'pinterest' => '', 'alignment' => 'center', 'font_size' => '18px', 'icon_color' => '', 'css' => 'none', ), $atts ) ); /* Set Classes and Styles */ $id = 'vcg-button-'.gillion_rand(); $class = array(); $class[] = $id; $class[] = ( $alignment ) ? 'vcg-social-networks-alignment-'.$alignment : ''; $css = []; $css[] = ( $font_size ) ? 'font-size: '.$font_size : ''; $css[] = ( $icon_color ) ? 'color: '.$icon_color : ''; // Record all output for WPBakery if( !isset( $atts['elementor'] ) ) : $class[] = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $settings_base = '', $atts ); ob_start(); endif; ?> <div class="vcg-social-networks <?php echo implode( ' ', $class ); ?>"> <?php if( !isset( $atts['elementor'] ) ) : ?> <style media="screen"> .<?php echo esc_attr( $id ); ?> i { <?php echo implode( ';', $css ); ?> } </style> <?php endif; ?> <div class="vcg-social-networks-container"> <?php if( $facebook ) : ?> <a href="<?php echo esc_url( $facebook ); ?>" target = "_blank" class="vcg-social-networks-item"> <i class="fa fa-facebook"></i> </a> <?php endif; ?> <?php if( $twitter ) : ?> <a href="<?php echo esc_url( $twitter ); ?>" target = "_blank" class="vcg-social-networks-item"> <i class="fa fa-twitter"></i> </a> <?php endif; ?> <?php if( $tumblr ) : ?> <a href="<?php echo esc_url( $tumblr ); ?>" target = "_blank" class="vcg-social-networks-item"> <i class="fa fa-tumblr"></i> </a> <?php endif; ?> <?php if( $pinterest ) : ?> <a href="<?php echo esc_url( $pinterest ); ?>" target = "_blank" class="vcg-social-networks-item"> <i class="fa fa-pinterest"></i> </a> <?php endif; ?> </div> </div> <?php // Show all output for WPBakery if( !isset( $atts['elementor'] ) ) : return ob_get_clean(); endif; } } new vcSocialNetworks();
Copyright ©2k19 -
Hexid
|
Tex7ure