PluginProbe
Borderless – Addons and Templates for Elementor / trunk
Borderless – Addons and Templates for Elementor vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 78 releases
borderless / modules / wpbakery / elements / icon-group.php

icon-group.php in Borderless – Addons and Templates for Elementor trunk, at modules/wpbakery/elements/icon-group.php

118 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( '-1' );
4 }
5
6 /*-----------------------------------------------------------------------------------*/
7 /* Icon Group
8 /*-----------------------------------------------------------------------------------*/
9
10 class WPBakeryShortCode_borderless_wpbakery_icon_group extends WPBakeryShortCodesContainer {
11 protected function content( $atts, $content = null ) {
12 extract( shortcode_atts( array(
13 'direction' => 'row',
14 'justify_content' => 'flex-start',
15 //Static
16 'el_id' => '',
17 'el_class' => '',
18 'css' => '',
19 'css_animation' => ''
20 ), $atts ) );
21 $output = '';
22
23 // Assets.
24 wp_enqueue_style(
25 'borderless-wpbakery-style',
26 BORDERLESS__STYLES . 'wpbakery.min.css',
27 false,
28 BORDERLESS__VERSION
29 );
30
31 // Retrieve data from the database.
32 $options = get_option( 'borderless' );
33
34 // Set default values
35 $borderless_primary_color = isset( $options['primary_color'] ) ? esc_attr( $options['primary_color'] ) : '#3379fc'; //Primary Color
36 $borderless_secondary_color = isset( $options['secondary_color'] ) ? esc_attr( $options['secondary_color'] ) : '#3379fc'; //Secondary Color
37 $borderless_text_color = isset( $options['text_color'] ) ? esc_attr( $options['text_color'] ) : ''; //Text Color
38 $borderless_accent_color = isset( $options['accent_color'] ) ? esc_attr( $options['accent_color'] ) : '#3379fc'; //Accent Color
39
40 // Default Extra Class, CSS and CSS animation
41 $css = isset( $atts['css'] ) ? esc_attr( $atts['css'] ) : '';
42 $el_id = isset( $atts['el_id'] ) ? 'id="' . esc_attr( $atts['el_id'] ) . '"' : '';
43 $el_class = isset( $atts['el_class'] ) ? esc_attr( $atts['el_class'] ) : '';
44 if ( '' !== $css_animation ) {
45 wp_enqueue_script( 'waypoints' );
46 $css_animation_style = ' wpb_animate_when_almost_visible wpb_' . esc_attr( $css_animation );
47 }
48 $class_to_filter = vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
49 $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
50
51 // Output
52 $output .= '<div ' . $el_id . ' class="borderless-wpbakery-icon-group ' . esc_attr( $css_class ) . '" style="justify-content:' . esc_attr( $justify_content ) . '; flex-direction:' . esc_attr( $direction ) . '">';
53 $output .= wpb_js_remove_wpautop( $content );
54 $output .= '</div>';
55
56 return $output;
57 }
58 }
59
60 vc_map( array(
61 'name' => __( 'Icon Group', 'borderless' ),
62 'base' => 'borderless_wpbakery_icon_group',
63 'icon' => plugins_url('../images/icon-group.png', __FILE__),
64 "as_parent" => array( 'only' => 'borderless_wpbakery_icon' ),
65 "content_element" => true,
66 "show_settings_on_create" => false,
67 "is_container" => true,
68 'category' => __( 'Borderless', 'borderless' ),
69 'description' => __( 'Add and manage multiple icons', 'borderless' ),
70 'params' => array(
71 array(
72 'type' => 'dropdown',
73 'heading' => __( 'Direction', 'borderless' ),
74 'param_name' => 'direction',
75 'value' => array(
76 __( 'Row', 'borderless' ) => 'row',
77 __( 'Row Reverse', 'borderless' ) => 'row-reverse',
78 __( 'Column', 'borderless' ) => 'column',
79 __( 'Column Reverse', 'borderless' ) => 'column-reverse',
80 ),
81 'description' => __( 'Select the direction icons list.', 'borderless' ),
82 ),
83 array(
84 'type' => 'dropdown',
85 'heading' => __( 'Justify Content', 'borderless' ),
86 'param_name' => 'justify_content',
87 'value' => array(
88 __( 'Left', 'borderless' ) => 'flex-start',
89 __( 'Right', 'borderless' ) => 'flex-end',
90 __( 'Center', 'borderless' ) => 'center',
91 __( 'Space Around', 'borderless' ) => 'space-around',
92 __( 'Space Between', 'borderless' ) => 'space-between',
93 ),
94 'description' => __( 'Select icons alignment.', 'borderless' ),
95 ),
96 vc_map_add_css_animation(),
97 array(
98 'type' => 'el_id',
99 'heading' => __( 'Element ID', 'borderless' ),
100 'param_name' => 'el_id',
101 'description' => sprintf( __( 'Enter element ID (Note: make sure it is unique and valid according to %sw3c specification%s).', 'borderless' ), '<a href="https://www.w3schools.com/tags/att_global_id.asp" target="_blank">', '</a>' ),
102 ),
103 array(
104 'type' => 'textfield',
105 'heading' => __( 'Extra class name', 'borderless' ),
106 'param_name' => 'el_class',
107 'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'borderless' ),
108 ),
109 array(
110 'type' => 'css_editor',
111 'heading' => __( 'CSS box', 'borderless' ),
112 'param_name' => 'css',
113 'group' => __( 'Design Options', 'borderless' ),
114 ),
115 ),
116 "js_view" => 'VcColumnView'
117 ) );
118