PATH:
home
/
lab2454c
/
fcxpro.com
/
wp-content
/
plugins
/
webon-core
/
inc
/
widgets
/
social-icons-group
<?php if ( ! function_exists( 'webon_core_add_social_icons_group_widget' ) ) { /** * function that add widget into widgets list for registration * * @param array $widgets * * @return array */ function webon_core_add_social_icons_group_widget( $widgets ) { $widgets[] = 'WebOnCoreSocialIconsGroupWidget'; return $widgets; } add_filter( 'webon_core_filter_register_widgets', 'webon_core_add_social_icons_group_widget' ); } if ( class_exists( 'QodeFrameworkWidget' ) ) { class WebOnCoreSocialIconsGroupWidget extends QodeFrameworkWidget { public $no_of_icons = 5; public function map_widget() { $this->set_base( 'webon_core_social_icons_group' ); $this->set_name( esc_html__( 'WebOn Social Icons Group', 'webon-core' ) ); $this->set_description( sprintf( esc_html__( 'Use this widget to add a group of up to %s social icons to a widget area.', 'webon-core' ), $this->no_of_icons ) ); $this->set_widget_option( array( 'field_type' => 'text', 'name' => 'widget_title', 'title' => esc_html__( 'Title', 'webon-core' ), ) ); for ( $i = 1; $i <= $this->no_of_icons; $i ++ ) { $this->set_widget_option( array( 'field_type' => 'iconpack', 'name' => 'main_icon_' . $i, 'title' => sprintf( esc_html__( 'Icon %s', 'webon-core' ), $i ), ) ); $this->set_widget_option( array( 'field_type' => 'text', 'name' => 'link_' . $i, 'title' => sprintf( esc_html__( 'Link %s', 'webon-core' ), $i ), ) ); $this->set_widget_option( array( 'field_type' => 'select', 'name' => 'target_' . $i, 'title' => sprintf( esc_html__( 'Link %s Target', 'webon-core' ), $i ), 'options' => webon_core_get_select_type_options_pool( 'link_target', false ), 'default_value' => '_blank' ) ); $this->set_widget_option( array( 'field_type' => 'text', 'name' => 'custom_size_' . $i, 'title' => sprintf( esc_html__( 'Icon %s Size', 'webon-core' ), $i ), ) ); $this->set_widget_option( array( 'field_type' => 'text', 'name' => 'margin_' . $i, 'title' => sprintf( esc_html__( 'Icon %s Margin', 'webon-core' ), $i ), ) ); $this->set_widget_option( array( 'field_type' => 'color', 'name' => 'icon_color_' . $i, 'title' => sprintf( esc_html__( 'Icon %s Color', 'webon-core' ), $i ), ) ); $this->set_widget_option( array( 'field_type' => 'color', 'name' => 'icon_background_color_' . $i, 'title' => sprintf( esc_html__( 'Icon %s Background Color', 'webon-core' ), $i ), ) ); $this->set_widget_option( array( 'field_type' => 'color', 'name' => 'icon_hover_color_' . $i, 'title' => sprintf( esc_html__( 'Icon %s Hover Color', 'webon-core' ), $i ), ) ); $this->set_widget_option( array( 'field_type' => 'color', 'name' => 'icon_hover_background_color_' . $i, 'title' => sprintf( esc_html__( 'Icon %s Hover Background Color', 'webon-core' ), $i ), ) ); } } public function render( $atts ) { ?> <div class="qodef-social-icons-group"> <?php for ( $i = 1; $i <= $this->no_of_icons; $i ++ ) { $selected_icon_pack = str_replace( '-', '_', $atts[ 'main_icon_' . $i ] ); if ( ! empty( $atts[ 'main_icon_' . $i . '_' . $selected_icon_pack ] ) ) { $params = array( 'main_icon' => $atts[ 'main_icon_' . $i ], 'main_icon_' . $selected_icon_pack => $atts[ 'main_icon_' . $i . '_' . $selected_icon_pack ], 'link' => $atts[ 'link_' . $i ], 'target' => $atts[ 'target_' . $i ], 'custom_size' => $atts[ 'custom_size_' . $i ], 'margin' => $atts[ 'margin_' . $i ], 'background_color' => $atts[ 'icon_background_color_' . $i ], 'color' => $atts[ 'icon_color_' . $i ], 'hover_background_color' => $atts[ 'icon_hover_background_color_' . $i ], 'hover_color' => $atts[ 'icon_hover_color_' . $i ], ); $params = $this->generate_string_params( $params ); echo do_shortcode( "[webon_core_icon $params]" ); // XSS OK } } ?> </div> <?php } } }
[+]
..
[-] social-icons-group.php
[edit]
[-] include.php
[edit]
[+]
assets