Version Description
- 2017-11-16
Download this release
Release Info
Developer | themeisle |
Plugin | Elementor Addons & Templates – Sizzify Lite |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.1.2
- CHANGELOG.md +8 -2
- css/eaw.css +18 -18
- eaw-class.php +54 -3
- elementor-addon-widgets.php +6 -5
- readme.md +12 -2
- readme.txt +12 -2
- widgets/elementor/css/public.css +293 -0
- widgets/elementor/js/obfx-grid.js +62 -0
- widgets/elementor/posts-grid.php +1763 -0
- widgets/elementor/pricing-table.php +1056 -0
- widgets/elementor/services.php +615 -0
- widgets/woo/best-products.php +53 -44
- widgets/woo/featured-products.php +52 -41
- widgets/woo/popular-products.php +50 -39
- widgets/woo/products-categories.php +13 -13
- widgets/woo/recent-products.php +11 -11
- widgets/woo/sale-products.php +11 -11
- widgets/wp/eaw-posts-widget-plus.php +12 -12
- widgets/wp/eaw-posts-widget.php +9 -9
CHANGELOG.md
CHANGED
@@ -1,7 +1,13 @@
|
|
1 |
|
2 |
-
### v1.1.
|
3 |
**Changes:**
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
### v1.1.1 - 2017-10-11
|
6 |
**Changes:**
|
7 |
* Updated title and description
|
1 |
|
2 |
+
### v1.1.2 - 2017-11-16
|
3 |
**Changes:**
|
4 |
+
* Tested up to 4.9.
|
5 |
+
|
6 |
+
### v1.1.2 - 2017-11-16
|
7 |
+
**Changes:**
|
8 |
+
* Added three new Elementor native widgets.
|
9 |
+
* Tested up to 4.9
|
10 |
+
|
11 |
### v1.1.1 - 2017-10-11
|
12 |
**Changes:**
|
13 |
* Updated title and description
|
css/eaw.css
CHANGED
@@ -8,8 +8,8 @@
|
|
8 |
|
9 |
.elementor-widget-wp-widget-eaw-recent-posts h5,
|
10 |
.elementor-widget-wp-widget-eaw-recent-posts-plus h5 {
|
11 |
-
|
12 |
-
|
13 |
text-align: center;
|
14 |
}
|
15 |
|
@@ -39,26 +39,26 @@
|
|
39 |
}
|
40 |
|
41 |
@media screen and (max-width: 768px) {
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
.eaw-recent-posts img {
|
49 |
-
|
50 |
margin: 0 auto;
|
51 |
-
|
52 |
}
|
53 |
|
54 |
@media screen and (max-width: 667px) {
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
.eaw-recent-posts img {
|
61 |
-
|
62 |
margin: 0 auto;
|
63 |
-
|
64 |
-
}
|
8 |
|
9 |
.elementor-widget-wp-widget-eaw-recent-posts h5,
|
10 |
.elementor-widget-wp-widget-eaw-recent-posts-plus h5 {
|
11 |
+
font-size: 1.75rem;
|
12 |
+
line-height: 1.75;
|
13 |
text-align: center;
|
14 |
}
|
15 |
|
39 |
}
|
40 |
|
41 |
@media screen and (max-width: 768px) {
|
42 |
+
.eaw-recent-posts {
|
43 |
+
width: 48%;
|
44 |
+
padding: 0;
|
45 |
+
margin: 0 1%;
|
46 |
+
}
|
47 |
+
|
48 |
.eaw-recent-posts img {
|
49 |
+
height: 300px;
|
50 |
margin: 0 auto;
|
51 |
+
}
|
52 |
}
|
53 |
|
54 |
@media screen and (max-width: 667px) {
|
55 |
+
.eaw-recent-posts {
|
56 |
+
width: 100%;
|
57 |
+
margin: 0;
|
58 |
+
}
|
59 |
+
|
60 |
.eaw-recent-posts img {
|
61 |
+
height: 300px;
|
62 |
margin: 0 auto;
|
63 |
+
}
|
64 |
+
}
|
eaw-class.php
CHANGED
@@ -55,10 +55,60 @@ class Elementor_Addon_Widgets {
|
|
55 |
|
56 |
add_action( 'wp_enqueue_scripts', array( $this, 'eaw_styles' ), 999 );
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
/**
|
63 |
* WooCommerce Widget section
|
64 |
*
|
@@ -106,6 +156,7 @@ class Elementor_Addon_Widgets {
|
|
106 |
*/
|
107 |
public function eaw_styles() {
|
108 |
wp_enqueue_style( 'eaw-styles', plugins_url( '/css/eaw.css', __FILE__ ) );
|
|
|
109 |
}
|
110 |
}
|
111 |
add_action( 'plugins_loaded', array( 'Elementor_Addon_Widgets', 'get_instance' ) );
|
55 |
|
56 |
add_action( 'wp_enqueue_scripts', array( $this, 'eaw_styles' ), 999 );
|
57 |
|
58 |
+
add_action( 'elementor/init', array( $this, 'add_elementor_category' ) );
|
59 |
+
|
60 |
+
add_action( 'elementor/widgets/widgets_registered', array( $this, 'add_elementor_widgets' ) );
|
61 |
+
|
62 |
+
add_action( 'elementor/frontend/after_register_scripts', array( $this, 'enqueue_elementor' ) );
|
63 |
+
|
64 |
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Add the Category for Orbit Fox Widgets.
|
68 |
+
*/
|
69 |
+
public function add_elementor_category() {
|
70 |
+
\Elementor\Plugin::instance()->elements_manager->add_category(
|
71 |
+
'eaw-elementor-widgets',
|
72 |
+
array(
|
73 |
+
'title' => __( 'EAW Widgets', 'elementor-addon-widgets' ),
|
74 |
+
'icon' => 'fa fa-plug',
|
75 |
+
),
|
76 |
+
1
|
77 |
+
);
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Require and instantiate Elementor Widgets.
|
82 |
+
*
|
83 |
+
* @param $widgets_manager
|
84 |
+
*/
|
85 |
+
public static function add_elementor_widgets( $widgets_manager ) {
|
86 |
+
$elementor_widgets = array(
|
87 |
+
'pricing-table',
|
88 |
+
'services',
|
89 |
+
'posts-grid',
|
90 |
+
);
|
91 |
+
|
92 |
+
foreach ( $elementor_widgets as $widget ) {
|
93 |
+
require_once EA_PATH . 'widgets/elementor/' . $widget . '.php';
|
94 |
+
}
|
95 |
+
|
96 |
+
// Pricing table
|
97 |
+
$widget = new Elementor\EAW_Elementor_Widget_Pricing_Table();
|
98 |
+
$widgets_manager->register_widget_type( $widget );
|
99 |
+
// Services
|
100 |
+
$widget = new Elementor\EAW_Elementor_Widget_Services();
|
101 |
+
$widgets_manager->register_widget_type( $widget );
|
102 |
+
// Posts grid
|
103 |
+
$widget = new Elementor\EAW_Elementor_Widget_Posts_Grid();
|
104 |
+
$widgets_manager->register_widget_type( $widget );
|
105 |
+
}
|
106 |
+
|
107 |
+
public function enqueue_elementor() {
|
108 |
+
// Add custom JS for grid.
|
109 |
+
wp_enqueue_script( 'obfx-grid-js', plugins_url( '/widgets/elementor/js/obfx-grid.js', __FILE__ ), array(), '1.0', true );
|
110 |
+
}
|
111 |
+
|
112 |
/**
|
113 |
* WooCommerce Widget section
|
114 |
*
|
156 |
*/
|
157 |
public function eaw_styles() {
|
158 |
wp_enqueue_style( 'eaw-styles', plugins_url( '/css/eaw.css', __FILE__ ) );
|
159 |
+
wp_enqueue_style( 'eaw-elementor', plugins_url( '/widgets/elementor/css/public.css', __FILE__ ) );
|
160 |
}
|
161 |
}
|
162 |
add_action( 'plugins_loaded', array( 'Elementor_Addon_Widgets', 'get_instance' ) );
|
elementor-addon-widgets.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Plugin Name: Elementor Addons & Widgets
|
4 |
* Plugin URI: https://themeisle.com/
|
5 |
* Description: Adds new Addons & Widgets that are specifically designed to be used in conjunction with the Elementor Page Builder.
|
6 |
-
* Version: 1.1.
|
7 |
* Author: ThemeIsle
|
8 |
* Author URI: https://themeisle.com/
|
9 |
* Requires at least: 4.4
|
10 |
-
* Tested up to: 4.
|
11 |
*
|
12 |
* Requires License: no
|
13 |
* WordPress Available: yes
|
@@ -15,14 +15,15 @@
|
|
15 |
|
16 |
/* Do not access this file directly */
|
17 |
if ( ! defined( 'WPINC' ) ) {
|
18 |
-
die;
|
|
|
19 |
|
20 |
/*
|
21 |
-
|
22 |
------------------------------------------ */
|
23 |
|
24 |
/* Set plugin version constant. */
|
25 |
-
define( 'EA_VERSION', '1.1.
|
26 |
|
27 |
/* Set constant path to the plugin directory. */
|
28 |
define( 'EA_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
|
3 |
* Plugin Name: Elementor Addons & Widgets
|
4 |
* Plugin URI: https://themeisle.com/
|
5 |
* Description: Adds new Addons & Widgets that are specifically designed to be used in conjunction with the Elementor Page Builder.
|
6 |
+
* Version: 1.1.2
|
7 |
* Author: ThemeIsle
|
8 |
* Author URI: https://themeisle.com/
|
9 |
* Requires at least: 4.4
|
10 |
+
* Tested up to: 4.9
|
11 |
*
|
12 |
* Requires License: no
|
13 |
* WordPress Available: yes
|
15 |
|
16 |
/* Do not access this file directly */
|
17 |
if ( ! defined( 'WPINC' ) ) {
|
18 |
+
die;
|
19 |
+
}
|
20 |
|
21 |
/*
|
22 |
+
Constants
|
23 |
------------------------------------------ */
|
24 |
|
25 |
/* Set plugin version constant. */
|
26 |
+
define( 'EA_VERSION', '1.1.2' );
|
27 |
|
28 |
/* Set constant path to the plugin directory. */
|
29 |
define( 'EA_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
|
readme.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
**Contributors:** [themeisle](https://profiles.wordpress.org/themeisle), [codeinwp](https://profiles.wordpress.org/codeinwp)
|
3 |
**Tags:** elementor, elementor addons, page builder template, page builder templates, woocommerce, template builder, builder templates
|
4 |
**Requires at least:** 4.4
|
5 |
-
**Tested up to:** 4.
|
6 |
**License:** GPLv3
|
7 |
**License URI:** https://www.gnu.org/licenses/gpl-3.0.html
|
8 |
|
@@ -16,9 +16,13 @@ Initial version contains 6(+2) widgets - more to come.
|
|
16 |
* 4: WooCommerce Featured Products
|
17 |
* 5: WooCommerce On Sale Products
|
18 |
* 6: WooCommerce Popular Products
|
19 |
-
|
20 |
* 7: New: EAW: Elementor Widget Recent Posts
|
21 |
* 8: New: EAW: Elementor Posts By Category
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
## Themes ##
|
24 |
Minimal support is included for almost any theme therefore leaving most of the design to be carried out in the themes themselves.
|
@@ -57,6 +61,12 @@ See this [issue #495](https://github.com/pojome/elementor/issues/495) for curren
|
|
57 |
4. Frontend view posts with custom title.
|
58 |
|
59 |
## Changelog ##
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
### 1.1.1 - 2017-10-11 ###
|
61 |
|
62 |
* Updated title and description
|
2 |
**Contributors:** [themeisle](https://profiles.wordpress.org/themeisle), [codeinwp](https://profiles.wordpress.org/codeinwp)
|
3 |
**Tags:** elementor, elementor addons, page builder template, page builder templates, woocommerce, template builder, builder templates
|
4 |
**Requires at least:** 4.4
|
5 |
+
**Tested up to:** 4.9
|
6 |
**License:** GPLv3
|
7 |
**License URI:** https://www.gnu.org/licenses/gpl-3.0.html
|
8 |
|
16 |
* 4: WooCommerce Featured Products
|
17 |
* 5: WooCommerce On Sale Products
|
18 |
* 6: WooCommerce Popular Products
|
|
|
19 |
* 7: New: EAW: Elementor Widget Recent Posts
|
20 |
* 8: New: EAW: Elementor Posts By Category
|
21 |
+
|
22 |
+
Elementor Native Widgets.
|
23 |
+
* 9: New: EAW Posts Grid
|
24 |
+
* 10: New: EAW Pricing Table
|
25 |
+
* 11: New: EAW Services
|
26 |
|
27 |
## Themes ##
|
28 |
Minimal support is included for almost any theme therefore leaving most of the design to be carried out in the themes themselves.
|
61 |
4. Frontend view posts with custom title.
|
62 |
|
63 |
## Changelog ##
|
64 |
+
### 1.1.2 - 2017-11-16 ###
|
65 |
+
|
66 |
+
* Added three new Elementor native widgets.
|
67 |
+
* Tested up to 4.9
|
68 |
+
|
69 |
+
|
70 |
### 1.1.1 - 2017-10-11 ###
|
71 |
|
72 |
* Updated title and description
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: themeisle, codeinwp
|
3 |
Tags: elementor, elementor addons, page builder template, page builder templates, woocommerce, template builder, builder templates
|
4 |
Requires at least: 4.4
|
5 |
-
Tested up to: 4.
|
6 |
License: GPLv3
|
7 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
8 |
|
@@ -16,9 +16,13 @@ Initial version contains 6(+2) widgets - more to come.
|
|
16 |
* 4: WooCommerce Featured Products
|
17 |
* 5: WooCommerce On Sale Products
|
18 |
* 6: WooCommerce Popular Products
|
19 |
-
|
20 |
* 7: New: EAW: Elementor Widget Recent Posts
|
21 |
* 8: New: EAW: Elementor Posts By Category
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
== Themes ==
|
24 |
Minimal support is included for almost any theme therefore leaving most of the design to be carried out in the themes themselves.
|
@@ -57,6 +61,12 @@ See this [issue #495](https://github.com/pojome/elementor/issues/495) for curren
|
|
57 |
4. Frontend view posts with custom title.
|
58 |
|
59 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
= 1.1.1 - 2017-10-11 =
|
61 |
|
62 |
* Updated title and description
|
2 |
Contributors: themeisle, codeinwp
|
3 |
Tags: elementor, elementor addons, page builder template, page builder templates, woocommerce, template builder, builder templates
|
4 |
Requires at least: 4.4
|
5 |
+
Tested up to: 4.9
|
6 |
License: GPLv3
|
7 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
8 |
|
16 |
* 4: WooCommerce Featured Products
|
17 |
* 5: WooCommerce On Sale Products
|
18 |
* 6: WooCommerce Popular Products
|
|
|
19 |
* 7: New: EAW: Elementor Widget Recent Posts
|
20 |
* 8: New: EAW: Elementor Posts By Category
|
21 |
+
|
22 |
+
Elementor Native Widgets.
|
23 |
+
* 9: New: EAW Posts Grid
|
24 |
+
* 10: New: EAW Pricing Table
|
25 |
+
* 11: New: EAW Services
|
26 |
|
27 |
== Themes ==
|
28 |
Minimal support is included for almost any theme therefore leaving most of the design to be carried out in the themes themselves.
|
61 |
4. Frontend view posts with custom title.
|
62 |
|
63 |
== Changelog ==
|
64 |
+
= 1.1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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Pricing Table Base CSS */
|
2 |
+
.obfx-pricing-table-wrapper, .obfx-pricing-table-wrapper p.obfx-pricing-table-subtitle {
|
3 |
+
text-align: center;
|
4 |
+
}
|
5 |
+
|
6 |
+
.obfx-pricing-table-wrapper a {
|
7 |
+
cursor: pointer;
|
8 |
+
}
|
9 |
+
|
10 |
+
.obfx-title-wrapper {
|
11 |
+
padding: 15px;
|
12 |
+
}
|
13 |
+
|
14 |
+
.obfx-pricing-table-title {
|
15 |
+
font-weight: 600;
|
16 |
+
}
|
17 |
+
|
18 |
+
.obfx-pricing-table-wrapper .obfx-feature-list {
|
19 |
+
list-style: none;
|
20 |
+
padding: 10px 50px;
|
21 |
+
margin: 0;
|
22 |
+
}
|
23 |
+
|
24 |
+
.obfx-pricing-table-wrapper .obfx-feature-list li {
|
25 |
+
font-size: 16px;
|
26 |
+
}
|
27 |
+
|
28 |
+
.obfx-price-wrapper {
|
29 |
+
padding: 20px 0;
|
30 |
+
}
|
31 |
+
|
32 |
+
.obfx-price {
|
33 |
+
line-height: normal;
|
34 |
+
font-size: 80px;
|
35 |
+
font-weight: 600;
|
36 |
+
}
|
37 |
+
|
38 |
+
.obfx-pricing-period,
|
39 |
+
.obfx-price-currency {
|
40 |
+
font-size: 21px;
|
41 |
+
}
|
42 |
+
|
43 |
+
.obfx-button-icon-align-right i {
|
44 |
+
margin-left: 5px;
|
45 |
+
}
|
46 |
+
.obfx-button-icon-align-left i {
|
47 |
+
margin-right: 5px;
|
48 |
+
}
|
49 |
+
|
50 |
+
.obfx-pricing-table-accented {
|
51 |
+
font-weight: 600;
|
52 |
+
}
|
53 |
+
|
54 |
+
.obfx-pricing-table-button-wrapper {
|
55 |
+
padding: 20px 0;
|
56 |
+
}
|
57 |
+
|
58 |
+
.obfx-pricing-table-button {
|
59 |
+
padding: 10px 20px;
|
60 |
+
border-radius: 5px;
|
61 |
+
}
|
62 |
+
/* End Of Pricing Table Base CSS */
|
63 |
+
|
64 |
+
/* Post Type Grid Base CSS */
|
65 |
+
|
66 |
+
.obfx-grid:after {
|
67 |
+
visibility: hidden;
|
68 |
+
display: block;
|
69 |
+
font-size: 0;
|
70 |
+
content: " ";
|
71 |
+
clear: both;
|
72 |
+
height: 0;
|
73 |
+
}
|
74 |
+
|
75 |
+
.obfx-grid-container {
|
76 |
+
display: -webkit-flex;
|
77 |
+
display: flex;
|
78 |
+
-webkit-flex-wrap: wrap;
|
79 |
+
flex-wrap: wrap;
|
80 |
+
margin-left: -15px;
|
81 |
+
margin-right: -15px;
|
82 |
+
}
|
83 |
+
|
84 |
+
.obfx-grid-wrapper {
|
85 |
+
padding-left: 15px;
|
86 |
+
padding-right: 15px;
|
87 |
+
}
|
88 |
+
|
89 |
+
.obfx-grid .obfx-grid-col-image {
|
90 |
+
display: block;
|
91 |
+
margin: 0 0 10px 0;
|
92 |
+
overflow: hidden;
|
93 |
+
position: relative;
|
94 |
+
left: 0;
|
95 |
+
right: 0;
|
96 |
+
bottom: 0;
|
97 |
+
top: 0;
|
98 |
+
-webkit-box-shadow: 0px 3px 10px 0px rgba(181,181,181,1);
|
99 |
+
-moz-box-shadow: 0px 3px 10px 0px rgba(181,181,181,1);
|
100 |
+
box-shadow: 0px 3px 10px 0px rgba(181,181,181,1);
|
101 |
+
}
|
102 |
+
|
103 |
+
.obfx-grid .obfx-grid-col-image {
|
104 |
+
display: inline-block;
|
105 |
+
height: 200px;
|
106 |
+
width: 100%;
|
107 |
+
}
|
108 |
+
|
109 |
+
.obfx-grid .obfx-grid-col-image.obfx-fit-height img {
|
110 |
+
height: 100%;
|
111 |
+
width: auto;
|
112 |
+
}
|
113 |
+
|
114 |
+
.obfx-grid .obfx-grid-col-image img {
|
115 |
+
display: block;
|
116 |
+
height: auto;
|
117 |
+
left: 50%;
|
118 |
+
position: absolute;
|
119 |
+
max-height: none;
|
120 |
+
max-width: none;
|
121 |
+
top: 50%;
|
122 |
+
transform: translate(-50%,-50%);
|
123 |
+
width: 100%;
|
124 |
+
}
|
125 |
+
|
126 |
+
.obfx-grid .obfx-grid-title,
|
127 |
+
.obfx-grid .obfx-grid-title a {
|
128 |
+
color: #333;
|
129 |
+
font-size: 24px;
|
130 |
+
line-height: 1.5;
|
131 |
+
margin: 0;
|
132 |
+
}
|
133 |
+
|
134 |
+
.obfx-grid-meta {
|
135 |
+
margin: 0 0 10px 0;
|
136 |
+
}
|
137 |
+
|
138 |
+
.obfx-grid-meta > span {
|
139 |
+
color: #999;
|
140 |
+
font-size: 14px;
|
141 |
+
margin-right: 10px;
|
142 |
+
}
|
143 |
+
|
144 |
+
.obfx-grid-meta > span:last-of-type {
|
145 |
+
margin-right: 0;
|
146 |
+
}
|
147 |
+
|
148 |
+
.obfx-grid-meta .fa {
|
149 |
+
margin-right: 7px;
|
150 |
+
}
|
151 |
+
|
152 |
+
.obfx-grid-meta a {
|
153 |
+
color: #999;
|
154 |
+
text-decoration: none;
|
155 |
+
}
|
156 |
+
|
157 |
+
.obfx-grid-meta a:hover,
|
158 |
+
.obfx-grid-meta a:focus {
|
159 |
+
color: inherit;
|
160 |
+
text-decoration: underline;
|
161 |
+
}
|
162 |
+
|
163 |
+
.obfx-grid-categories-item:after,
|
164 |
+
.obfx-grid-tags-item:after {
|
165 |
+
content: ', ';
|
166 |
+
}
|
167 |
+
|
168 |
+
.obfx-grid-categories-item:last-of-type:after,
|
169 |
+
.obfx-grid-tags-item:last-of-type:after {
|
170 |
+
content: '';
|
171 |
+
display: none;
|
172 |
+
}
|
173 |
+
|
174 |
+
.obfx-grid-content {
|
175 |
+
color: #555;
|
176 |
+
font-size: 16px;
|
177 |
+
line-height: 1.5;
|
178 |
+
margin: 0 0 10px 0;
|
179 |
+
}
|
180 |
+
|
181 |
+
.obfx-grid-footer a {
|
182 |
+
color: #333;
|
183 |
+
display: inline-block;
|
184 |
+
font-size: 14px;
|
185 |
+
font-weight: 700;
|
186 |
+
}
|
187 |
+
|
188 |
+
.obfx-grid-container.obfx-grid-style-list .obfx-grid-col {
|
189 |
+
display: -webkit-flex;
|
190 |
+
display: flex;
|
191 |
+
-webkit-flex-wrap: wrap;
|
192 |
+
flex-wrap: wrap;
|
193 |
+
}
|
194 |
+
|
195 |
+
.obfx-grid-container.obfx-grid-style-list .obfx-grid-col-image {
|
196 |
+
width: 40%;
|
197 |
+
}
|
198 |
+
|
199 |
+
.obfx-grid-container.obfx-grid-style-list .obfx-grid-col-content {
|
200 |
+
padding-left: 15px;
|
201 |
+
width: 60%;
|
202 |
+
}
|
203 |
+
|
204 |
+
.obfx-grid-container.obfx-grid-style-list .obfx-grid-col.obfx-no-image .obfx-grid-col-content {
|
205 |
+
padding-left: 0;
|
206 |
+
width: 100%;
|
207 |
+
}
|
208 |
+
|
209 |
+
.obfx-grid-pagination {
|
210 |
+
width: 100%;
|
211 |
+
}
|
212 |
+
|
213 |
+
.obfx-grid-desktop-1 .obfx-grid-wrapper {
|
214 |
+
width: 100%;
|
215 |
+
}
|
216 |
+
|
217 |
+
.obfx-grid-desktop-2 .obfx-grid-wrapper {
|
218 |
+
width: 50%;
|
219 |
+
}
|
220 |
+
|
221 |
+
.obfx-grid-desktop-3 .obfx-grid-wrapper {
|
222 |
+
width: 33.333%;
|
223 |
+
}
|
224 |
+
|
225 |
+
.obfx-grid-desktop-4 .obfx-grid-wrapper {
|
226 |
+
width: 25%;
|
227 |
+
}
|
228 |
+
|
229 |
+
.obfx-grid-desktop-5 .obfx-grid-wrapper {
|
230 |
+
width: 20%;
|
231 |
+
}
|
232 |
+
|
233 |
+
@media (max-width: 992px) {
|
234 |
+
.obfx-grid-tablet-1 .obfx-grid-wrapper {
|
235 |
+
width: 100%;
|
236 |
+
}
|
237 |
+
|
238 |
+
.obfx-grid-tablet-2 .obfx-grid-wrapper {
|
239 |
+
width: 50%;
|
240 |
+
}
|
241 |
+
|
242 |
+
.obfx-grid-tablet-3 .obfx-grid-wrapper {
|
243 |
+
width: 33.333%;
|
244 |
+
}
|
245 |
+
|
246 |
+
.obfx-grid-tablet-4 .obfx-grid-wrapper {
|
247 |
+
width: 25%;
|
248 |
+
}
|
249 |
+
|
250 |
+
.obfx-grid-tablet-5 .obfx-grid-wrapper {
|
251 |
+
width: 20%;
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
@media (max-width: 767px) {
|
256 |
+
.obfx-grid-mobile-1 .obfx-grid-wrapper {
|
257 |
+
width: 100%;
|
258 |
+
}
|
259 |
+
|
260 |
+
.obfx-grid-mobile-2 .obfx-grid-wrapper {
|
261 |
+
width: 50%;
|
262 |
+
}
|
263 |
+
|
264 |
+
.obfx-grid-mobile-3 .obfx-grid-wrapper {
|
265 |
+
width: 33.333%;
|
266 |
+
}
|
267 |
+
|
268 |
+
.obfx-grid-mobile-4 .obfx-grid-wrapper {
|
269 |
+
width: 25%;
|
270 |
+
}
|
271 |
+
|
272 |
+
.obfx-grid-mobile-5 .obfx-grid-wrapper {
|
273 |
+
width: 20%;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
/* End Of Post Type Grid Base CSS */
|
277 |
+
|
278 |
+
.obfx-service-box {
|
279 |
+
display: flex;
|
280 |
+
}
|
281 |
+
|
282 |
+
.obfx-position-left .obfx-service-box {
|
283 |
+
flex-direction: row;
|
284 |
+
}
|
285 |
+
.obfx-position-right .obfx-service-box {
|
286 |
+
flex-direction: row-reverse;
|
287 |
+
}
|
288 |
+
.obfx-position-top .obfx-service-box {
|
289 |
+
flex-direction: column;
|
290 |
+
}
|
291 |
+
.obfx-service-box .obfx-service-box-content .obfx-service-title, .obfx-service-box .obfx-service-box-content .obfx-service-text {
|
292 |
+
margin: 0;
|
293 |
+
}
|
widgets/elementor/js/obfx-grid.js
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global elementor */
|
2 |
+
|
3 |
+
(function ($) {
|
4 |
+
|
5 |
+
$( document ).ready(
|
6 |
+
function(){
|
7 |
+
checkImageSize();
|
8 |
+
}
|
9 |
+
);
|
10 |
+
|
11 |
+
$( window ).resize(
|
12 |
+
function () {
|
13 |
+
checkImageSize();
|
14 |
+
}
|
15 |
+
);
|
16 |
+
|
17 |
+
$( window ).on(
|
18 |
+
'elementor/frontend/init', function () {
|
19 |
+
elementor.hooks.addAction(
|
20 |
+
'panel/open_editor/widget/obfx-posts-grid', function (panel) {
|
21 |
+
var $element = panel.$el.find( '.elementor-control-section_grid_image' );
|
22 |
+
$element.click(
|
23 |
+
function() {
|
24 |
+
panel.$el.find( '.elementor-control-grid_image_height .elementor-control-input-wrapper' ).mouseup(
|
25 |
+
function() {
|
26 |
+
checkImageSize();
|
27 |
+
}
|
28 |
+
);
|
29 |
+
}
|
30 |
+
);
|
31 |
+
}
|
32 |
+
);
|
33 |
+
}
|
34 |
+
);
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Check the container and image size.
|
38 |
+
*/
|
39 |
+
function checkImageSize() {
|
40 |
+
$( '.obfx-grid .obfx-grid-col' ).each(
|
41 |
+
function () {
|
42 |
+
var container = $( this ).find( '.obfx-grid-col-image' ),
|
43 |
+
containerWidth = $( this ).find( '.obfx-grid-col-image' ).width(),
|
44 |
+
containerHeight = $( this ).find( '.obfx-grid-col-image' ).height(),
|
45 |
+
imageWidth = $( this ).find( '.obfx-grid-col-image img' ).width(),
|
46 |
+
imageHeight = $( this ).find( '.obfx-grid-col-image img' ).height();
|
47 |
+
|
48 |
+
if ($( this ).find( '.obfx-grid-col-image' ).length > 0) {
|
49 |
+
|
50 |
+
if (containerHeight > imageHeight) {
|
51 |
+
container.addClass( 'obfx-fit-height' );
|
52 |
+
}
|
53 |
+
|
54 |
+
if (containerWidth > imageWidth && container.hasClass( 'obfx-fit-height' )) {
|
55 |
+
container.removeClass( 'obfx-fit-height' );
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
);
|
60 |
+
}
|
61 |
+
|
62 |
+
})(jQuery);
|
widgets/elementor/posts-grid.php
ADDED
@@ -0,0 +1,1763 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Orbit Fox Elementor Features Widget
|
4 |
+
*
|
5 |
+
* @link https://themeisle.com
|
6 |
+
* @since 1.0.0
|
7 |
+
*
|
8 |
+
* @package Elementor_Widgets_EAW_Module
|
9 |
+
*/
|
10 |
+
|
11 |
+
namespace Elementor;
|
12 |
+
|
13 |
+
|
14 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
15 |
+
exit;
|
16 |
+
} // Exit if accessed directly
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Class EAW_Elementor_Widget_Features
|
20 |
+
*
|
21 |
+
* @package Elementor_Widgets_EAW_Module
|
22 |
+
*/
|
23 |
+
class EAW_Elementor_Widget_Posts_Grid extends Widget_Base {
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Widget title.
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
public function get_title() {
|
31 |
+
return __( 'EAW Posts Grid', 'elementor-addon-widgets' );
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Widget icon.
|
36 |
+
*
|
37 |
+
* @return string
|
38 |
+
*/
|
39 |
+
public function get_icon() {
|
40 |
+
return 'eicon-posts-grid';
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Widget name.
|
45 |
+
*
|
46 |
+
* @return string
|
47 |
+
*/
|
48 |
+
public function get_name() {
|
49 |
+
return 'obfx-posts-grid';
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Widget Category.
|
54 |
+
*
|
55 |
+
* @return array
|
56 |
+
*/
|
57 |
+
public function get_categories() {
|
58 |
+
return [ 'eaw-elementor-widgets' ];
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Register Elementor Controls.
|
63 |
+
*/
|
64 |
+
protected function _register_controls() {
|
65 |
+
// Content.
|
66 |
+
$this->grid_options_section();
|
67 |
+
$this->grid_image_section();
|
68 |
+
$this->grid_title_section();
|
69 |
+
$this->grid_meta_section();
|
70 |
+
$this->grid_content_section();
|
71 |
+
$this->grid_pagination_section();
|
72 |
+
// Style.
|
73 |
+
$this->grid_options_style_section();
|
74 |
+
$this->grid_image_style_section();
|
75 |
+
$this->grid_title_style_section();
|
76 |
+
$this->grid_meta_style_section();
|
77 |
+
$this->grid_content_style_section();
|
78 |
+
$this->grid_pagination_style_section();
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Content > Grid.
|
83 |
+
*/
|
84 |
+
private function grid_options_section() {
|
85 |
+
$this->start_controls_section(
|
86 |
+
'section_grid',
|
87 |
+
[
|
88 |
+
'label' => __( 'Grid Options', 'elementor-addon-widgets' ),
|
89 |
+
]
|
90 |
+
);
|
91 |
+
|
92 |
+
// Post type.
|
93 |
+
$this->add_control(
|
94 |
+
'grid_post_type',
|
95 |
+
[
|
96 |
+
'type' => Controls_Manager::SELECT,
|
97 |
+
'label' => '<i class="fa fa-tag"></i> ' . __( 'Post Type', 'elementor-addon-widgets' ),
|
98 |
+
'default' => 'post',
|
99 |
+
'options' => $this->grid_get_all_post_types(),
|
100 |
+
]
|
101 |
+
);
|
102 |
+
|
103 |
+
// Post categories.
|
104 |
+
$this->add_control(
|
105 |
+
'grid_post_categories',
|
106 |
+
[
|
107 |
+
'type' => Controls_Manager::SELECT,
|
108 |
+
'label' => '<i class="fa fa-folder"></i> ' . __( 'Category', 'elementor-addon-widgets' ),
|
109 |
+
'options' => $this->grid_get_all_post_type_categories( 'post' ),
|
110 |
+
'condition' => [
|
111 |
+
'grid_post_type' => 'post',
|
112 |
+
],
|
113 |
+
]
|
114 |
+
);
|
115 |
+
|
116 |
+
// Product categories.
|
117 |
+
$this->add_control(
|
118 |
+
'grid_product_categories',
|
119 |
+
[
|
120 |
+
'type' => Controls_Manager::SELECT,
|
121 |
+
'label' => '<i class="fa fa-tag"></i> ' . __( 'Category', 'elementor-addon-widgets' ),
|
122 |
+
'options' => $this->grid_get_all_post_type_categories( 'product' ),
|
123 |
+
'condition' => [
|
124 |
+
'grid_post_type' => 'product',
|
125 |
+
],
|
126 |
+
]
|
127 |
+
);
|
128 |
+
|
129 |
+
// Style.
|
130 |
+
$this->add_control(
|
131 |
+
'grid_style',
|
132 |
+
[
|
133 |
+
'type' => Controls_Manager::SELECT,
|
134 |
+
'label' => '<i class="fa fa-paint-brush"></i> ' . __( 'Style', 'elementor-addon-widgets' ),
|
135 |
+
'default' => 'grid',
|
136 |
+
'options' => [
|
137 |
+
'grid' => __( 'Grid', 'elementor-addon-widgets' ),
|
138 |
+
'list' => __( 'List', 'elementor-addon-widgets' ),
|
139 |
+
],
|
140 |
+
]
|
141 |
+
);
|
142 |
+
|
143 |
+
// Items.
|
144 |
+
$this->add_control(
|
145 |
+
'grid_items',
|
146 |
+
[
|
147 |
+
'type' => Controls_Manager::NUMBER,
|
148 |
+
'label' => '<i class="fa fa-th-large"></i> ' . __( 'Items', 'elementor-addon-widgets' ),
|
149 |
+
'placeholder' => __( 'How many items?', 'elementor-addon-widgets' ),
|
150 |
+
'default' => 6,
|
151 |
+
]
|
152 |
+
);
|
153 |
+
|
154 |
+
// Columns.
|
155 |
+
$this->add_responsive_control(
|
156 |
+
'grid_columns',
|
157 |
+
[
|
158 |
+
'type' => Controls_Manager::SELECT,
|
159 |
+
'label' => '<i class="fa fa-columns"></i> ' . __( 'Columns', 'elementor-addon-widgets' ),
|
160 |
+
'default' => 3,
|
161 |
+
'tablet_default' => 2,
|
162 |
+
'mobile_default' => 1,
|
163 |
+
'options' => [
|
164 |
+
1 => 1,
|
165 |
+
2 => 2,
|
166 |
+
3 => 3,
|
167 |
+
4 => 4,
|
168 |
+
5 => 5,
|
169 |
+
],
|
170 |
+
]
|
171 |
+
);
|
172 |
+
|
173 |
+
// Order by.
|
174 |
+
$this->add_control(
|
175 |
+
'grid_order_by',
|
176 |
+
[
|
177 |
+
'type' => Controls_Manager::SELECT,
|
178 |
+
'label' => '<i class="fa fa-sort"></i> ' . __( 'Order by', 'elementor-addon-widgets' ),
|
179 |
+
'default' => 'date',
|
180 |
+
'options' => [
|
181 |
+
'date' => __( 'Date', 'elementor-addon-widgets' ),
|
182 |
+
'title' => __( 'Title', 'elementor-addon-widgets' ),
|
183 |
+
'modified' => __( 'Modified date', 'elementor-addon-widgets' ),
|
184 |
+
'comment_count' => __( 'Comment count', 'elementor-addon-widgets' ),
|
185 |
+
'rand' => __( 'Random', 'elementor-addon-widgets' ),
|
186 |
+
],
|
187 |
+
]
|
188 |
+
);
|
189 |
+
|
190 |
+
// Display pagination.
|
191 |
+
$this->add_control(
|
192 |
+
'grid_pagination',
|
193 |
+
[
|
194 |
+
'label' => '<i class="fa fa-arrow-circle-right"></i> ' . __( 'Pagination', 'elementor-addon-widgets' ),
|
195 |
+
'type' => Controls_Manager::SWITCHER,
|
196 |
+
'default' => '',
|
197 |
+
]
|
198 |
+
);
|
199 |
+
|
200 |
+
$this->end_controls_section();
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Get post types.
|
205 |
+
*/
|
206 |
+
private function grid_get_all_post_types() {
|
207 |
+
$options = array();
|
208 |
+
$exclude = array( 'attachment', 'elementor_library' ); // excluded post types
|
209 |
+
|
210 |
+
$args = array(
|
211 |
+
'public' => true,
|
212 |
+
);
|
213 |
+
|
214 |
+
foreach ( get_post_types( $args, 'objects' ) as $post_type ) {
|
215 |
+
// Check if post type name exists.
|
216 |
+
if ( ! isset( $post_type->name ) ) {
|
217 |
+
continue;
|
218 |
+
}
|
219 |
+
|
220 |
+
// Check if post type label exists.
|
221 |
+
if ( ! isset( $post_type->label ) ) {
|
222 |
+
continue;
|
223 |
+
}
|
224 |
+
|
225 |
+
// Check if post type is excluded.
|
226 |
+
if ( in_array( $post_type->name, $exclude ) === true ) {
|
227 |
+
continue;
|
228 |
+
}
|
229 |
+
|
230 |
+
$options[ $post_type->name ] = $post_type->label;
|
231 |
+
}
|
232 |
+
|
233 |
+
return $options;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Get post type categories.
|
238 |
+
*/
|
239 |
+
private function grid_get_all_post_type_categories( $post_type ) {
|
240 |
+
$options = array();
|
241 |
+
|
242 |
+
if ( $post_type == 'post' ) {
|
243 |
+
$taxonomy = 'category';
|
244 |
+
} else {
|
245 |
+
$taxonomy = 'product_cat';
|
246 |
+
}
|
247 |
+
|
248 |
+
// Get categories for post type.
|
249 |
+
$terms = get_terms(
|
250 |
+
array(
|
251 |
+
'taxonomy' => $taxonomy,
|
252 |
+
'hide_empty' => false,
|
253 |
+
)
|
254 |
+
);
|
255 |
+
|
256 |
+
foreach ( $terms as $term ) {
|
257 |
+
$options[ $term->slug ] = $term->name;
|
258 |
+
}
|
259 |
+
|
260 |
+
return $options;
|
261 |
+
}
|
262 |
+
|
263 |
+
/**
|
264 |
+
* Content > Image Options.
|
265 |
+
*/
|
266 |
+
private function grid_image_section() {
|
267 |
+
$this->start_controls_section(
|
268 |
+
'section_grid_image',
|
269 |
+
[
|
270 |
+
'label' => __( 'Image', 'elementor-addon-widgets' ),
|
271 |
+
]
|
272 |
+
);
|
273 |
+
|
274 |
+
// Hide image.
|
275 |
+
$this->add_control(
|
276 |
+
'grid_image_hide',
|
277 |
+
[
|
278 |
+
'label' => '<i class="fa fa-minus-circle"></i> ' . __( 'Hide', 'elementor-addon-widgets' ),
|
279 |
+
'type' => Controls_Manager::SWITCHER,
|
280 |
+
'default' => '',
|
281 |
+
]
|
282 |
+
);
|
283 |
+
|
284 |
+
// Image height.
|
285 |
+
$this->add_control(
|
286 |
+
'grid_image_height',
|
287 |
+
[
|
288 |
+
'label' => '<i class="fa fa-arrows-h"></i> ' . __( 'Image height', 'elementor-addon-widgets' ),
|
289 |
+
'type' => Controls_Manager::SLIDER,
|
290 |
+
'default' => [
|
291 |
+
'size' => 220,
|
292 |
+
],
|
293 |
+
'range' => [
|
294 |
+
'px' => [
|
295 |
+
'min' => 1,
|
296 |
+
'max' => 1000,
|
297 |
+
'step' => 1,
|
298 |
+
],
|
299 |
+
],
|
300 |
+
'selectors' => [
|
301 |
+
'{{WRAPPER}} .obfx-grid-col-image' => 'height: {{SIZE}}{{UNIT}};',
|
302 |
+
],
|
303 |
+
]
|
304 |
+
);
|
305 |
+
|
306 |
+
// Image link.
|
307 |
+
$this->add_control(
|
308 |
+
'grid_image_link',
|
309 |
+
[
|
310 |
+
'label' => '<i class="fa fa-link"></i> ' . __( 'Link', 'elementor-addon-widgets' ),
|
311 |
+
'type' => Controls_Manager::SWITCHER,
|
312 |
+
'default' => 'yes',
|
313 |
+
]
|
314 |
+
);
|
315 |
+
|
316 |
+
$this->end_controls_section();
|
317 |
+
}
|
318 |
+
|
319 |
+
/**
|
320 |
+
* Content > Title Options.
|
321 |
+
*/
|
322 |
+
private function grid_title_section() {
|
323 |
+
$this->start_controls_section(
|
324 |
+
'section_grid_title',
|
325 |
+
[
|
326 |
+
'label' => __( 'Title', 'elementor-addon-widgets' ),
|
327 |
+
]
|
328 |
+
);
|
329 |
+
|
330 |
+
// Hide title.
|
331 |
+
$this->add_control(
|
332 |
+
'grid_title_hide',
|
333 |
+
[
|
334 |
+
'label' => '<i class="fa fa-minus-circle"></i> ' . __( 'Hide', 'elementor-addon-widgets' ),
|
335 |
+
'type' => Controls_Manager::SWITCHER,
|
336 |
+
'default' => '',
|
337 |
+
]
|
338 |
+
);
|
339 |
+
|
340 |
+
// Title tag.
|
341 |
+
$this->add_control(
|
342 |
+
'grid_title_tag',
|
343 |
+
[
|
344 |
+
'type' => Controls_Manager::SELECT,
|
345 |
+
'label' => '<i class="fa fa-code"></i> ' . __( 'Tag', 'elementor-addon-widgets' ),
|
346 |
+
'default' => 'h2',
|
347 |
+
'options' => [
|
348 |
+
'h1' => 'H1',
|
349 |
+
'h2' => 'H2',
|
350 |
+
'h3' => 'H3',
|
351 |
+
'h4' => 'H4',
|
352 |
+
'h5' => 'H5',
|
353 |
+
'h6' => 'Hh6',
|
354 |
+
'span' => 'span',
|
355 |
+
'p' => 'p',
|
356 |
+
'div' => 'div',
|
357 |
+
],
|
358 |
+
]
|
359 |
+
);
|
360 |
+
|
361 |
+
// Title link.
|
362 |
+
$this->add_control(
|
363 |
+
'grid_title_link',
|
364 |
+
[
|
365 |
+
'label' => '<i class="fa fa-link"></i> ' . __( 'Link', 'elementor-addon-widgets' ),
|
366 |
+
'type' => Controls_Manager::SWITCHER,
|
367 |
+
'default' => 'yes',
|
368 |
+
]
|
369 |
+
);
|
370 |
+
|
371 |
+
$this->end_controls_section();
|
372 |
+
}
|
373 |
+
|
374 |
+
/**
|
375 |
+
* Content > Meta Options.
|
376 |
+
*/
|
377 |
+
private function grid_meta_section() {
|
378 |
+
$this->start_controls_section(
|
379 |
+
'section_grid_meta',
|
380 |
+
[
|
381 |
+
'label' => __( 'Meta', 'elementor-addon-widgets' ),
|
382 |
+
]
|
383 |
+
);
|
384 |
+
|
385 |
+
// Hide content.
|
386 |
+
$this->add_control(
|
387 |
+
'grid_meta_hide',
|
388 |
+
[
|
389 |
+
'label' => '<i class="fa fa-minus-circle"></i> ' . __( 'Hide', 'elementor-addon-widgets' ),
|
390 |
+
'type' => Controls_Manager::SWITCHER,
|
391 |
+
'default' => '',
|
392 |
+
]
|
393 |
+
);
|
394 |
+
|
395 |
+
// Meta.
|
396 |
+
$this->add_control(
|
397 |
+
'grid_meta_display',
|
398 |
+
[
|
399 |
+
'label' => '<i class="fa fa-info-circle"></i> ' . __( 'Display', 'elementor-addon-widgets' ),
|
400 |
+
'label_block' => true,
|
401 |
+
'type' => Controls_Manager::SELECT2,
|
402 |
+
'default' => [ 'author', 'date' ],
|
403 |
+
'multiple' => true,
|
404 |
+
'options' => [
|
405 |
+
'author' => __( 'Author', 'elementor-addon-widgets' ),
|
406 |
+
'date' => __( 'Date', 'elementor-addon-widgets' ),
|
407 |
+
'category' => __( 'Category', 'elementor-addon-widgets' ),
|
408 |
+
'tags' => __( 'Tags', 'elementor-addon-widgets' ),
|
409 |
+
'comments' => __( 'Comments', 'elementor-addon-widgets' ),
|
410 |
+
],
|
411 |
+
]
|
412 |
+
);
|
413 |
+
|
414 |
+
// No. of Categories.
|
415 |
+
$this->add_control(
|
416 |
+
'grid_meta_categories_max',
|
417 |
+
[
|
418 |
+
'type' => Controls_Manager::NUMBER,
|
419 |
+
'label' => __( 'No. of Categories', 'elementor-addon-widgets' ),
|
420 |
+
'placeholder' => __( 'How many categories to display?', 'elementor-addon-widgets' ),
|
421 |
+
'default' => __( '1', 'elementor-addon-widgets' ),
|
422 |
+
'condition' => [
|
423 |
+
'grid_meta_display' => 'category',
|
424 |
+
],
|
425 |
+
]
|
426 |
+
);
|
427 |
+
|
428 |
+
// No. of Tags.
|
429 |
+
$this->add_control(
|
430 |
+
'grid_meta_tags_max',
|
431 |
+
[
|
432 |
+
'type' => Controls_Manager::NUMBER,
|
433 |
+
'label' => __( 'No. of Tags', 'elementor-addon-widgets' ),
|
434 |
+
'placeholder' => __( 'How many tags to display?', 'elementor-addon-widgets' ),
|
435 |
+
'condition' => [
|
436 |
+
'grid_meta_display' => 'tags',
|
437 |
+
],
|
438 |
+
]
|
439 |
+
);
|
440 |
+
|
441 |
+
// Remove meta icons.
|
442 |
+
$this->add_control(
|
443 |
+
'grid_meta_remove_icons',
|
444 |
+
[
|
445 |
+
'label' => '<i class="fa fa-minus-circle"></i> ' . __( 'Remove icons', 'elementor-addon-widgets' ),
|
446 |
+
'type' => Controls_Manager::SWITCHER,
|
447 |
+
'default' => '',
|
448 |
+
]
|
449 |
+
);
|
450 |
+
|
451 |
+
$this->end_controls_section();
|
452 |
+
}
|
453 |
+
|
454 |
+
/**
|
455 |
+
* Content > Content Options.
|
456 |
+
*/
|
457 |
+
private function grid_content_section() {
|
458 |
+
$this->start_controls_section(
|
459 |
+
'section_grid_content',
|
460 |
+
[
|
461 |
+
'label' => __( 'Content', 'elementor-addon-widgets' ),
|
462 |
+
]
|
463 |
+
);
|
464 |
+
|
465 |
+
// Hide content.
|
466 |
+
$this->add_control(
|
467 |
+
'grid_content_hide',
|
468 |
+
[
|
469 |
+
'label' => '<i class="fa fa-minus-circle"></i> ' . __( 'Hide', 'elementor-addon-widgets' ),
|
470 |
+
'type' => Controls_Manager::SWITCHER,
|
471 |
+
'default' => '',
|
472 |
+
]
|
473 |
+
);
|
474 |
+
|
475 |
+
// Length.
|
476 |
+
$this->add_control(
|
477 |
+
'grid_content_length',
|
478 |
+
[
|
479 |
+
'type' => Controls_Manager::NUMBER,
|
480 |
+
'label' => '<i class="fa fa-arrows-h"></i> ' . __( 'Length (words)', 'elementor-addon-widgets' ),
|
481 |
+
'placeholder' => __( 'Length of content (words)', 'elementor-addon-widgets' ),
|
482 |
+
'default' => __( '55', 'elementor-addon-widgets' ),
|
483 |
+
]
|
484 |
+
);
|
485 |
+
|
486 |
+
// Price.
|
487 |
+
$this->add_control(
|
488 |
+
'grid_content_price',
|
489 |
+
[
|
490 |
+
'label' => '<i class="fa fa-usd"></i> ' . __( 'Price', 'elementor-addon-widgets' ),
|
491 |
+
'type' => Controls_Manager::SWITCHER,
|
492 |
+
'default' => 'yes',
|
493 |
+
'condition' => [
|
494 |
+
'section_grid.grid_post_type' => 'product',
|
495 |
+
],
|
496 |
+
]
|
497 |
+
);
|
498 |
+
|
499 |
+
// Read more button hide.
|
500 |
+
$this->add_control(
|
501 |
+
'grid_content_default_btn',
|
502 |
+
[
|
503 |
+
'label' => '<i class="fa fa-check-square"></i> ' . __( 'Button', 'elementor-addon-widgets' ),
|
504 |
+
'type' => Controls_Manager::SWITCHER,
|
505 |
+
'default' => 'yes',
|
506 |
+
'condition' => [
|
507 |
+
'section_grid.grid_post_type!' => 'product',
|
508 |
+
],
|
509 |
+
]
|
510 |
+
);
|
511 |
+
|
512 |
+
// Default button text.
|
513 |
+
$this->add_control(
|
514 |
+
'grid_content_default_btn_text',
|
515 |
+
[
|
516 |
+
'type' => Controls_Manager::TEXT,
|
517 |
+
'label' => __( 'Button text', 'elementor-addon-widgets' ),
|
518 |
+
'placeholder' => __( 'Read more', 'elementor-addon-widgets' ),
|
519 |
+
'default' => __( 'Read more', 'elementor-addon-widgets' ),
|
520 |
+
'condition' => [
|
521 |
+
'grid_content_default_btn!' => '',
|
522 |
+
'section_grid.grid_post_type!' => 'product',
|
523 |
+
],
|
524 |
+
]
|
525 |
+
);
|
526 |
+
|
527 |
+
// Add to cart button hide.
|
528 |
+
$this->add_control(
|
529 |
+
'grid_content_product_btn',
|
530 |
+
[
|
531 |
+
'label' => '<i class="fa fa-check-square"></i> ' . __( 'Button', 'elementor-addon-widgets' ),
|
532 |
+
'type' => Controls_Manager::SWITCHER,
|
533 |
+
'default' => 'yes',
|
534 |
+
'condition' => [
|
535 |
+
'section_grid.grid_post_type' => 'product',
|
536 |
+
],
|
537 |
+
]
|
538 |
+
);
|
539 |
+
|
540 |
+
// Button alignment.
|
541 |
+
$this->add_responsive_control(
|
542 |
+
'grid_content_btn_alignment',
|
543 |
+
[
|
544 |
+
'label' => __( 'Button alignment', 'elementor-addon-widgets' ),
|
545 |
+
'type' => Controls_Manager::CHOOSE,
|
546 |
+
'options' => [
|
547 |
+
'left' => [
|
548 |
+
'title' => __( 'Left', 'elementor-addon-widgets' ),
|
549 |
+
'icon' => 'fa fa-align-left',
|
550 |
+
],
|
551 |
+
'center' => [
|
552 |
+
'title' => __( 'Center', 'elementor-addon-widgets' ),
|
553 |
+
'icon' => 'fa fa-align-center',
|
554 |
+
],
|
555 |
+
'right' => [
|
556 |
+
'title' => __( 'Right', 'elementor-addon-widgets' ),
|
557 |
+
'icon' => 'fa fa-align-right',
|
558 |
+
],
|
559 |
+
'justify' => [
|
560 |
+
'title' => __( 'Justified', 'elementor-addon-widgets' ),
|
561 |
+
'icon' => 'fa fa-align-justify',
|
562 |
+
],
|
563 |
+
],
|
564 |
+
'default' => 'left',
|
565 |
+
'tablet_default' => 'left',
|
566 |
+
'mobile_default' => 'center',
|
567 |
+
'selectors' => [
|
568 |
+
'{{WRAPPER}} .obfx-grid-footer' => 'text-align: {{VALUE}};',
|
569 |
+
],
|
570 |
+
'condition' => [
|
571 |
+
'grid_content_btn!' => '',
|
572 |
+
],
|
573 |
+
]
|
574 |
+
);
|
575 |
+
|
576 |
+
// Content alignment.
|
577 |
+
$this->add_responsive_control(
|
578 |
+
'grid_content_alignment',
|
579 |
+
[
|
580 |
+
'label' => '<i class="fa fa-align-right"></i> ' . __( 'Alignment', 'elementor-addon-widgets' ),
|
581 |
+
'type' => Controls_Manager::CHOOSE,
|
582 |
+
'options' => [
|
583 |
+
'left' => [
|
584 |
+
'title' => __( 'Left', 'elementor-addon-widgets' ),
|
585 |
+
'icon' => 'fa fa-align-left',
|
586 |
+
],
|
587 |
+
'center' => [
|
588 |
+
'title' => __( 'Center', 'elementor-addon-widgets' ),
|
589 |
+
'icon' => 'fa fa-align-center',
|
590 |
+
],
|
591 |
+
'right' => [
|
592 |
+
'title' => __( 'Right', 'elementor-addon-widgets' ),
|
593 |
+
'icon' => 'fa fa-align-right',
|
594 |
+
],
|
595 |
+
],
|
596 |
+
'default' => 'left',
|
597 |
+
'tablet_default' => 'left',
|
598 |
+
'mobile_default' => 'center',
|
599 |
+
'selectors' => [
|
600 |
+
'{{WRAPPER}} .obfx-grid-col-content' => 'text-align: {{VALUE}};',
|
601 |
+
],
|
602 |
+
]
|
603 |
+
);
|
604 |
+
|
605 |
+
$this->end_controls_section();
|
606 |
+
}
|
607 |
+
|
608 |
+
/**
|
609 |
+
* Content > Pagination Options.
|
610 |
+
*/
|
611 |
+
private function grid_pagination_section() {
|
612 |
+
$this->start_controls_section(
|
613 |
+
'section_grid_pagination',
|
614 |
+
[
|
615 |
+
'label' => __( 'Pagination', 'elementor-addon-widgets' ),
|
616 |
+
'condition' => [
|
617 |
+
'section_grid.grid_pagination' => 'yes',
|
618 |
+
],
|
619 |
+
]
|
620 |
+
);
|
621 |
+
|
622 |
+
// Pagination alignment.
|
623 |
+
$this->add_responsive_control(
|
624 |
+
'grid_pagination_alignment',
|
625 |
+
[
|
626 |
+
'label' => __( 'Alignment', 'elementor-addon-widgets' ),
|
627 |
+
'type' => Controls_Manager::CHOOSE,
|
628 |
+
'options' => [
|
629 |
+
'left' => [
|
630 |
+
'title' => __( 'Left', 'elementor-addon-widgets' ),
|
631 |
+
'icon' => 'fa fa-align-left',
|
632 |
+
],
|
633 |
+
'center' => [
|
634 |
+
'title' => __( 'Center', 'elementor-addon-widgets' ),
|
635 |
+
'icon' => 'fa fa-align-center',
|
636 |
+
],
|
637 |
+
'right' => [
|
638 |
+
'title' => __( 'Right', 'elementor-addon-widgets' ),
|
639 |
+
'icon' => 'fa fa-align-right',
|
640 |
+
],
|
641 |
+
],
|
642 |
+
'default' => 'center',
|
643 |
+
'tablet_default' => 'center',
|
644 |
+
'mobile_default' => 'center',
|
645 |
+
'selectors' => [
|
646 |
+
'{{WRAPPER}} .obfx-grid-pagination .pagination' => 'text-align: {{VALUE}};',
|
647 |
+
],
|
648 |
+
]
|
649 |
+
);
|
650 |
+
|
651 |
+
$this->end_controls_section();
|
652 |
+
}
|
653 |
+
|
654 |
+
/**
|
655 |
+
* Style > Grid options.
|
656 |
+
*/
|
657 |
+
private function grid_options_style_section() {
|
658 |
+
// Tab.
|
659 |
+
$this->start_controls_section(
|
660 |
+
'section_grid_style',
|
661 |
+
[
|
662 |
+
'label' => __( 'Grid Options', 'elementor-addon-widgets' ),
|
663 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
664 |
+
]
|
665 |
+
);
|
666 |
+
|
667 |
+
// Columns margin.
|
668 |
+
$this->add_control(
|
669 |
+
'grid_style_columns_margin',
|
670 |
+
[
|
671 |
+
'label' => __( 'Columns margin', 'elementor-addon-widgets' ),
|
672 |
+
'type' => Controls_Manager::SLIDER,
|
673 |
+
'default' => [
|
674 |
+
'size' => 15,
|
675 |
+
],
|
676 |
+
'range' => [
|
677 |
+
'px' => [
|
678 |
+
'min' => 0,
|
679 |
+
'max' => 100,
|
680 |
+
],
|
681 |
+
],
|
682 |
+
'selectors' => [
|
683 |
+
'{{WRAPPER}} .obfx-grid-wrapper' => 'padding-right: calc( {{SIZE}}{{UNIT}} ); padding-left: calc( {{SIZE}}{{UNIT}} );',
|
684 |
+
'{{WRAPPER}} .obfx-grid-container' => 'margin-left: calc( -{{SIZE}}{{UNIT}} ); margin-right: calc( -{{SIZE}}{{UNIT}} );',
|
685 |
+
],
|
686 |
+
]
|
687 |
+
);
|
688 |
+
|
689 |
+
// Row margin.
|
690 |
+
$this->add_control(
|
691 |
+
'grid_style_rows_margin',
|
692 |
+
[
|
693 |
+
'label' => __( 'Rows margin', 'elementor-addon-widgets' ),
|
694 |
+
'type' => Controls_Manager::SLIDER,
|
695 |
+
'default' => [
|
696 |
+
'size' => 30,
|
697 |
+
],
|
698 |
+
'range' => [
|
699 |
+
'px' => [
|
700 |
+
'min' => 0,
|
701 |
+
'max' => 100,
|
702 |
+
],
|
703 |
+
],
|
704 |
+
'selectors' => [
|
705 |
+
'{{WRAPPER}} .obfx-grid-wrapper' => 'padding-bottom: {{SIZE}}{{UNIT}};',
|
706 |
+
],
|
707 |
+
]
|
708 |
+
);
|
709 |
+
|
710 |
+
// Background.
|
711 |
+
$this->add_group_control(
|
712 |
+
Group_Control_Background::get_type(),
|
713 |
+
[
|
714 |
+
'name' => 'grid_style_background',
|
715 |
+
'types' => [ 'classic', 'gradient' ],
|
716 |
+
'selector' => '{{WRAPPER}} .obfx-grid',
|
717 |
+
]
|
718 |
+
);
|
719 |
+
|
720 |
+
// Items options.
|
721 |
+
$this->add_control(
|
722 |
+
'grid_items_style_heading',
|
723 |
+
[
|
724 |
+
'label' => __( 'Items', 'elementor-addon-widgets' ),
|
725 |
+
'type' => Controls_Manager::HEADING,
|
726 |
+
'separator' => 'before',
|
727 |
+
]
|
728 |
+
);
|
729 |
+
|
730 |
+
// Items internal padding.
|
731 |
+
$this->add_control(
|
732 |
+
'grid_items_style_padding',
|
733 |
+
[
|
734 |
+
'label' => __( 'Padding', 'elementor-addon-widgets' ),
|
735 |
+
'type' => Controls_Manager::DIMENSIONS,
|
736 |
+
'size_units' => [ 'px', '%' ],
|
737 |
+
'selectors' => [
|
738 |
+
'{{WRAPPER}} .obfx-grid-col' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
739 |
+
],
|
740 |
+
]
|
741 |
+
);
|
742 |
+
|
743 |
+
// Items border radius.
|
744 |
+
$this->add_control(
|
745 |
+
'grid_items_style_border_radius',
|
746 |
+
[
|
747 |
+
'label' => __( 'Border Radius', 'elementor-addon-widgets' ),
|
748 |
+
'type' => Controls_Manager::DIMENSIONS,
|
749 |
+
'size_units' => [ 'px', '%' ],
|
750 |
+
'selectors' => [
|
751 |
+
'{{WRAPPER}} .obfx-grid-col' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
752 |
+
],
|
753 |
+
]
|
754 |
+
);
|
755 |
+
|
756 |
+
// Items box shadow.
|
757 |
+
$this->add_group_control(
|
758 |
+
Group_Control_Box_Shadow::get_type(),
|
759 |
+
[
|
760 |
+
'name' => 'grid_items_style_box_shadow',
|
761 |
+
'selector' => '{{WRAPPER}} .obfx-grid-col',
|
762 |
+
'separator' => '',
|
763 |
+
]
|
764 |
+
);
|
765 |
+
|
766 |
+
// Background for items options.
|
767 |
+
$this->add_group_control(
|
768 |
+
Group_Control_Background::get_type(),
|
769 |
+
[
|
770 |
+
'name' => 'grid_items_style_background',
|
771 |
+
'types' => [ 'classic', 'gradient' ],
|
772 |
+
'selector' => '{{WRAPPER}} .obfx-grid-col',
|
773 |
+
]
|
774 |
+
);
|
775 |
+
|
776 |
+
$this->end_controls_section();
|
777 |
+
}
|
778 |
+
|
779 |
+
/**
|
780 |
+
* Style > Image.
|
781 |
+
*/
|
782 |
+
private function grid_image_style_section() {
|
783 |
+
// Tab.
|
784 |
+
$this->start_controls_section(
|
785 |
+
'section_grid_image_style',
|
786 |
+
[
|
787 |
+
'label' => __( 'Image', 'elementor-addon-widgets' ),
|
788 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
789 |
+
'condition' => [
|
790 |
+
'section_grid_image.grid_image_hide' => '',
|
791 |
+
],
|
792 |
+
]
|
793 |
+
);
|
794 |
+
|
795 |
+
// Image border radius.
|
796 |
+
$this->add_control(
|
797 |
+
'grid_image_style_border_radius',
|
798 |
+
[
|
799 |
+
'label' => __( 'Border Radius', 'elementor-addon-widgets' ),
|
800 |
+
'type' => Controls_Manager::DIMENSIONS,
|
801 |
+
'size_units' => [ 'px', '%' ],
|
802 |
+
'selectors' => [
|
803 |
+
'{{WRAPPER}} .obfx-grid-col-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
804 |
+
],
|
805 |
+
'condition' => [
|
806 |
+
'section_grid_image.grid_image_hide' => '',
|
807 |
+
],
|
808 |
+
]
|
809 |
+
);
|
810 |
+
|
811 |
+
// Image box shadow.
|
812 |
+
$this->add_group_control(
|
813 |
+
Group_Control_Box_Shadow::get_type(),
|
814 |
+
[
|
815 |
+
'name' => 'grid_image_style_box_shadow',
|
816 |
+
'selector' => '{{WRAPPER}} .obfx-grid-col-image',
|
817 |
+
'separator' => '',
|
818 |
+
'condition' => [
|
819 |
+
'section_grid_image.grid_image_hide' => '',
|
820 |
+
],
|
821 |
+
]
|
822 |
+
);
|
823 |
+
|
824 |
+
// Image margin.
|
825 |
+
$this->add_control(
|
826 |
+
'grid_image_style_margin',
|
827 |
+
[
|
828 |
+
'label' => __( 'Margin', 'elementor-addon-widgets' ),
|
829 |
+
'type' => Controls_Manager::DIMENSIONS,
|
830 |
+
'size_units' => [ 'px' ],
|
831 |
+
'selectors' => [
|
832 |
+
'{{WRAPPER}} .obfx-grid-col-image' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
833 |
+
],
|
834 |
+
'condition' => [
|
835 |
+
'section_grid_image.grid_image_hide' => '',
|
836 |
+
],
|
837 |
+
]
|
838 |
+
);
|
839 |
+
|
840 |
+
$this->end_controls_section();
|
841 |
+
}
|
842 |
+
|
843 |
+
/**
|
844 |
+
* Style > Title.
|
845 |
+
*/
|
846 |
+
private function grid_title_style_section() {
|
847 |
+
// Tab.
|
848 |
+
$this->start_controls_section(
|
849 |
+
'section_grid_title_style',
|
850 |
+
[
|
851 |
+
'label' => __( 'Title', 'elementor-addon-widgets' ),
|
852 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
853 |
+
'condition' => [
|
854 |
+
'section_grid_title.grid_title_hide' => '',
|
855 |
+
],
|
856 |
+
]
|
857 |
+
);
|
858 |
+
|
859 |
+
// Title typography.
|
860 |
+
$this->add_group_control(
|
861 |
+
Group_Control_Typography::get_type(),
|
862 |
+
[
|
863 |
+
'name' => 'grid_title_style_typography',
|
864 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
865 |
+
'selector' => '{{WRAPPER}} .obfx-grid-title',
|
866 |
+
]
|
867 |
+
);
|
868 |
+
|
869 |
+
// Title color.
|
870 |
+
$this->add_control(
|
871 |
+
'grid_title_style_color',
|
872 |
+
[
|
873 |
+
'type' => Controls_Manager::COLOR,
|
874 |
+
'label' => __( 'Color', 'elementor-addon-widgets' ),
|
875 |
+
'scheme' => [
|
876 |
+
'type' => Scheme_Color::get_type(),
|
877 |
+
'value' => Scheme_Color::COLOR_1,
|
878 |
+
],
|
879 |
+
'selectors' => [
|
880 |
+
'{{WRAPPER}} .obfx-grid-title' => 'color: {{VALUE}};',
|
881 |
+
'{{WRAPPER}} .obfx-grid-title a' => 'color: {{VALUE}};',
|
882 |
+
],
|
883 |
+
]
|
884 |
+
);
|
885 |
+
|
886 |
+
// Title margin.
|
887 |
+
$this->add_control(
|
888 |
+
'grid_title_style_margin',
|
889 |
+
[
|
890 |
+
'label' => __( 'Margin', 'elementor-addon-widgets' ),
|
891 |
+
'type' => Controls_Manager::DIMENSIONS,
|
892 |
+
'size_units' => [ 'px' ],
|
893 |
+
'selectors' => [
|
894 |
+
'{{WRAPPER}} .obfx-grid-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
895 |
+
],
|
896 |
+
]
|
897 |
+
);
|
898 |
+
|
899 |
+
$this->end_controls_section();
|
900 |
+
}
|
901 |
+
|
902 |
+
/**
|
903 |
+
* Style > Meta.
|
904 |
+
*/
|
905 |
+
private function grid_meta_style_section() {
|
906 |
+
// Tab.
|
907 |
+
$this->start_controls_section(
|
908 |
+
'section_grid_meta_style',
|
909 |
+
[
|
910 |
+
'label' => __( 'Meta', 'elementor-addon-widgets' ),
|
911 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
912 |
+
'condition' => [
|
913 |
+
'section_grid_meta.grid_meta_hide' => '',
|
914 |
+
],
|
915 |
+
]
|
916 |
+
);
|
917 |
+
|
918 |
+
// Meta typography.
|
919 |
+
$this->add_group_control(
|
920 |
+
Group_Control_Typography::get_type(),
|
921 |
+
[
|
922 |
+
'name' => 'grid_meta_style_typography',
|
923 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
924 |
+
'selector' => '{{WRAPPER}} .obfx-grid-meta',
|
925 |
+
]
|
926 |
+
);
|
927 |
+
|
928 |
+
// Meta color.
|
929 |
+
$this->add_control(
|
930 |
+
'grid_meta_style_color',
|
931 |
+
[
|
932 |
+
'type' => Controls_Manager::COLOR,
|
933 |
+
'label' => __( 'Color', 'elementor-addon-widgets' ),
|
934 |
+
'scheme' => [
|
935 |
+
'type' => Scheme_Color::get_type(),
|
936 |
+
'value' => Scheme_Color::COLOR_1,
|
937 |
+
],
|
938 |
+
'selectors' => [
|
939 |
+
'{{WRAPPER}} .obfx-grid-meta' => 'color: {{VALUE}};',
|
940 |
+
'{{WRAPPER}} .obfx-grid-meta span' => 'color: {{VALUE}};',
|
941 |
+
'{{WRAPPER}} .obfx-grid-meta a' => 'color: {{VALUE}};',
|
942 |
+
],
|
943 |
+
]
|
944 |
+
);
|
945 |
+
|
946 |
+
// Meta margin.
|
947 |
+
$this->add_control(
|
948 |
+
'grid_meta_style_margin',
|
949 |
+
[
|
950 |
+
'label' => __( 'Margin', 'elementor-addon-widgets' ),
|
951 |
+
'type' => Controls_Manager::DIMENSIONS,
|
952 |
+
'size_units' => [ 'px' ],
|
953 |
+
'selectors' => [
|
954 |
+
'{{WRAPPER}} .obfx-grid-meta' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
955 |
+
],
|
956 |
+
]
|
957 |
+
);
|
958 |
+
|
959 |
+
$this->end_controls_section();
|
960 |
+
}
|
961 |
+
|
962 |
+
/**
|
963 |
+
* Style > Content.
|
964 |
+
*/
|
965 |
+
private function grid_content_style_section() {
|
966 |
+
// Tab.
|
967 |
+
$this->start_controls_section(
|
968 |
+
'section_grid_content_style',
|
969 |
+
[
|
970 |
+
'label' => __( 'Content', 'elementor-addon-widgets' ),
|
971 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
972 |
+
]
|
973 |
+
);
|
974 |
+
|
975 |
+
// Content typography.
|
976 |
+
$this->add_group_control(
|
977 |
+
Group_Control_Typography::get_type(),
|
978 |
+
[
|
979 |
+
'name' => 'grid_content_style_typography',
|
980 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
981 |
+
'selector' => '{{WRAPPER}} .obfx-grid-content',
|
982 |
+
'condition' => [
|
983 |
+
'section_grid_content.grid_content_hide' => '',
|
984 |
+
],
|
985 |
+
]
|
986 |
+
);
|
987 |
+
|
988 |
+
// Content color.
|
989 |
+
$this->add_control(
|
990 |
+
'grid_content_style_color',
|
991 |
+
[
|
992 |
+
'type' => Controls_Manager::COLOR,
|
993 |
+
'label' => __( 'Color', 'elementor-addon-widgets' ),
|
994 |
+
'scheme' => [
|
995 |
+
'type' => Scheme_Color::get_type(),
|
996 |
+
'value' => Scheme_Color::COLOR_1,
|
997 |
+
],
|
998 |
+
'selectors' => [
|
999 |
+
'{{WRAPPER}} .obfx-grid-content' => 'color: {{VALUE}};',
|
1000 |
+
],
|
1001 |
+
'condition' => [
|
1002 |
+
'section_grid_content.grid_content_hide' => '',
|
1003 |
+
],
|
1004 |
+
]
|
1005 |
+
);
|
1006 |
+
|
1007 |
+
// Content margin
|
1008 |
+
$this->add_control(
|
1009 |
+
'grid_content_style_margin',
|
1010 |
+
[
|
1011 |
+
'label' => __( 'Margin', 'elementor-addon-widgets' ),
|
1012 |
+
'type' => Controls_Manager::DIMENSIONS,
|
1013 |
+
'size_units' => [ 'px' ],
|
1014 |
+
'selectors' => [
|
1015 |
+
'{{WRAPPER}} .obfx-grid-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1016 |
+
],
|
1017 |
+
'condition' => [
|
1018 |
+
'section_grid_content.grid_content_hide' => '',
|
1019 |
+
],
|
1020 |
+
]
|
1021 |
+
);
|
1022 |
+
|
1023 |
+
// Heading for price options.
|
1024 |
+
$this->add_control(
|
1025 |
+
'grid_content_price_style_heading',
|
1026 |
+
[
|
1027 |
+
'label' => __( 'Price', 'elementor-addon-widgets' ),
|
1028 |
+
'type' => Controls_Manager::HEADING,
|
1029 |
+
'separator' => 'before',
|
1030 |
+
'condition' => [
|
1031 |
+
'section_grid_content.grid_content_price' => 'yes',
|
1032 |
+
'section_grid.grid_post_type' => 'product',
|
1033 |
+
],
|
1034 |
+
]
|
1035 |
+
);
|
1036 |
+
|
1037 |
+
// Price typography.
|
1038 |
+
$this->add_group_control(
|
1039 |
+
Group_Control_Typography::get_type(),
|
1040 |
+
[
|
1041 |
+
'name' => 'grid_content_price_style_typography',
|
1042 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
1043 |
+
'selector' => '{{WRAPPER}} .obfx-grid-price',
|
1044 |
+
'condition' => [
|
1045 |
+
'section_grid_content.grid_content_price' => 'yes',
|
1046 |
+
'section_grid.grid_post_type' => 'product',
|
1047 |
+
],
|
1048 |
+
]
|
1049 |
+
);
|
1050 |
+
|
1051 |
+
// Price color.
|
1052 |
+
$this->add_control(
|
1053 |
+
'grid_content_price_style_color',
|
1054 |
+
[
|
1055 |
+
'type' => Controls_Manager::COLOR,
|
1056 |
+
'label' => __( 'Color', 'elementor-addon-widgets' ),
|
1057 |
+
'scheme' => [
|
1058 |
+
'type' => Scheme_Color::get_type(),
|
1059 |
+
'value' => Scheme_Color::COLOR_1,
|
1060 |
+
],
|
1061 |
+
'selectors' => [
|
1062 |
+
'{{WRAPPER}} .obfx-grid-price' => 'color: {{VALUE}};',
|
1063 |
+
],
|
1064 |
+
'condition' => [
|
1065 |
+
'section_grid_content.grid_content_price' => 'yes',
|
1066 |
+
'section_grid.grid_post_type' => 'product',
|
1067 |
+
],
|
1068 |
+
]
|
1069 |
+
);
|
1070 |
+
|
1071 |
+
// Price bottom margin.
|
1072 |
+
$this->add_control(
|
1073 |
+
'grid_content_price_style_margin',
|
1074 |
+
[
|
1075 |
+
'label' => __( 'Margin', 'elementor-addon-widgets' ),
|
1076 |
+
'type' => Controls_Manager::DIMENSIONS,
|
1077 |
+
'size_units' => [ 'px' ],
|
1078 |
+
'selectors' => [
|
1079 |
+
'{{WRAPPER}} .obfx-grid-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1080 |
+
],
|
1081 |
+
'condition' => [
|
1082 |
+
'section_grid_content.grid_content_price' => 'yes',
|
1083 |
+
'section_grid.grid_post_type' => 'product',
|
1084 |
+
],
|
1085 |
+
]
|
1086 |
+
);
|
1087 |
+
|
1088 |
+
// Buttons options.
|
1089 |
+
$this->grid_content_style_button();
|
1090 |
+
|
1091 |
+
$this->end_controls_section();
|
1092 |
+
}
|
1093 |
+
|
1094 |
+
/**
|
1095 |
+
* Tabs for the Style > Button section.
|
1096 |
+
*/
|
1097 |
+
private function grid_content_style_button() {
|
1098 |
+
// Heading for button options.
|
1099 |
+
$this->add_control(
|
1100 |
+
'grid_button_style_heading',
|
1101 |
+
[
|
1102 |
+
'label' => __( 'Button', 'elementor-addon-widgets' ),
|
1103 |
+
'type' => Controls_Manager::HEADING,
|
1104 |
+
'separator' => 'before',
|
1105 |
+
'condition' => [
|
1106 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1107 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1108 |
+
],
|
1109 |
+
]
|
1110 |
+
);
|
1111 |
+
|
1112 |
+
// Content typography.
|
1113 |
+
$this->add_group_control(
|
1114 |
+
Group_Control_Typography::get_type(),
|
1115 |
+
[
|
1116 |
+
'name' => 'grid_button_style_typography',
|
1117 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
1118 |
+
'selector' => '{{WRAPPER}} .obfx-grid-footer a',
|
1119 |
+
'condition' => [
|
1120 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1121 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1122 |
+
],
|
1123 |
+
]
|
1124 |
+
);
|
1125 |
+
|
1126 |
+
$this->start_controls_tabs( 'grid_button_style' );
|
1127 |
+
|
1128 |
+
// Normal tab.
|
1129 |
+
$this->start_controls_tab(
|
1130 |
+
'grid_button_style_normal',
|
1131 |
+
[
|
1132 |
+
'label' => __( 'Normal', 'elementor-addon-widgets' ),
|
1133 |
+
'condition' => [
|
1134 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1135 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1136 |
+
],
|
1137 |
+
]
|
1138 |
+
);
|
1139 |
+
|
1140 |
+
// Normal text color.
|
1141 |
+
$this->add_control(
|
1142 |
+
'grid_button_style_normal_text_color',
|
1143 |
+
[
|
1144 |
+
'type' => Controls_Manager::COLOR,
|
1145 |
+
'label' => __( 'Text Color', 'elementor-addon-widgets' ),
|
1146 |
+
'scheme' => [
|
1147 |
+
'type' => Scheme_Color::get_type(),
|
1148 |
+
'value' => Scheme_Color::COLOR_1,
|
1149 |
+
],
|
1150 |
+
'separator' => '',
|
1151 |
+
'selectors' => [
|
1152 |
+
'{{WRAPPER}} .obfx-grid-footer a' => 'color: {{VALUE}};',
|
1153 |
+
],
|
1154 |
+
'condition' => [
|
1155 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1156 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1157 |
+
],
|
1158 |
+
]
|
1159 |
+
);
|
1160 |
+
|
1161 |
+
// Normal background color.
|
1162 |
+
$this->add_control(
|
1163 |
+
'grid_button_style_normal_bg_color',
|
1164 |
+
[
|
1165 |
+
'type' => Controls_Manager::COLOR,
|
1166 |
+
'label' => __( 'Background Color', 'elementor-addon-widgets' ),
|
1167 |
+
'scheme' => [
|
1168 |
+
'type' => Scheme_Color::get_type(),
|
1169 |
+
'value' => Scheme_Color::COLOR_1,
|
1170 |
+
],
|
1171 |
+
'separator' => '',
|
1172 |
+
'selectors' => [
|
1173 |
+
'{{WRAPPER}} .obfx-grid-footer a' => 'background-color: {{VALUE}};',
|
1174 |
+
],
|
1175 |
+
'condition' => [
|
1176 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1177 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1178 |
+
],
|
1179 |
+
]
|
1180 |
+
);
|
1181 |
+
|
1182 |
+
// Normal box shadow.
|
1183 |
+
$this->add_group_control(
|
1184 |
+
Group_Control_Box_Shadow::get_type(),
|
1185 |
+
[
|
1186 |
+
'name' => 'grid_button_style_normal_box_shadow',
|
1187 |
+
'selector' => '{{WRAPPER}} .obfx-grid-footer a',
|
1188 |
+
'separator' => '',
|
1189 |
+
'condition' => [
|
1190 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1191 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1192 |
+
],
|
1193 |
+
]
|
1194 |
+
);
|
1195 |
+
|
1196 |
+
$this->end_controls_tab();
|
1197 |
+
|
1198 |
+
// Hover tab.
|
1199 |
+
$this->start_controls_tab(
|
1200 |
+
'grid_button_style_hover',
|
1201 |
+
[
|
1202 |
+
'label' => __( 'Hover', 'elementor-addon-widgets' ),
|
1203 |
+
'condition' => [
|
1204 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1205 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1206 |
+
],
|
1207 |
+
]
|
1208 |
+
);
|
1209 |
+
|
1210 |
+
// Hover text color.
|
1211 |
+
$this->add_control(
|
1212 |
+
'grid_button_style_hover_text_color',
|
1213 |
+
[
|
1214 |
+
'type' => Controls_Manager::COLOR,
|
1215 |
+
'label' => __( 'Text Color', 'elementor-addon-widgets' ),
|
1216 |
+
'scheme' => [
|
1217 |
+
'type' => Scheme_Color::get_type(),
|
1218 |
+
'value' => Scheme_Color::COLOR_1,
|
1219 |
+
],
|
1220 |
+
'separator' => '',
|
1221 |
+
'selectors' => [
|
1222 |
+
'{{WRAPPER}} .obfx-grid-footer a:hover' => 'color: {{VALUE}};',
|
1223 |
+
],
|
1224 |
+
'condition' => [
|
1225 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1226 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1227 |
+
],
|
1228 |
+
]
|
1229 |
+
);
|
1230 |
+
|
1231 |
+
// Hover background color.
|
1232 |
+
$this->add_control(
|
1233 |
+
'grid_button_style_hover_bg_color',
|
1234 |
+
[
|
1235 |
+
'type' => Controls_Manager::COLOR,
|
1236 |
+
'label' => __( 'Background Color', 'elementor-addon-widgets' ),
|
1237 |
+
'scheme' => [
|
1238 |
+
'type' => Scheme_Color::get_type(),
|
1239 |
+
'value' => Scheme_Color::COLOR_1,
|
1240 |
+
],
|
1241 |
+
'separator' => '',
|
1242 |
+
'selectors' => [
|
1243 |
+
'{{WRAPPER}} .obfx-grid-footer a:hover' => 'background-color: {{VALUE}};',
|
1244 |
+
],
|
1245 |
+
'condition' => [
|
1246 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1247 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1248 |
+
],
|
1249 |
+
]
|
1250 |
+
);
|
1251 |
+
|
1252 |
+
// Hover box shadow.
|
1253 |
+
$this->add_group_control(
|
1254 |
+
Group_Control_Box_Shadow::get_type(),
|
1255 |
+
[
|
1256 |
+
'name' => 'grid_button_style_hover_box_shadow',
|
1257 |
+
'selector' => '{{WRAPPER}} .obfx-grid-footer a:hover',
|
1258 |
+
'separator' => '',
|
1259 |
+
'condition' => [
|
1260 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1261 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1262 |
+
],
|
1263 |
+
]
|
1264 |
+
);
|
1265 |
+
|
1266 |
+
$this->end_controls_tab();
|
1267 |
+
|
1268 |
+
$this->end_controls_tabs();
|
1269 |
+
|
1270 |
+
// Button padding.
|
1271 |
+
$this->add_control(
|
1272 |
+
'grid_button_style_padding',
|
1273 |
+
[
|
1274 |
+
'label' => __( 'Button padding', 'elementor-addon-widgets' ),
|
1275 |
+
'type' => Controls_Manager::DIMENSIONS,
|
1276 |
+
'size_units' => [ 'px' ],
|
1277 |
+
'selectors' => [
|
1278 |
+
'{{WRAPPER}} .obfx-grid-footer a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1279 |
+
],
|
1280 |
+
'condition' => [
|
1281 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1282 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1283 |
+
],
|
1284 |
+
]
|
1285 |
+
);
|
1286 |
+
|
1287 |
+
// Button border radius.
|
1288 |
+
$this->add_control(
|
1289 |
+
'grid_button_style_border_radius',
|
1290 |
+
[
|
1291 |
+
'label' => __( 'Button border radius', 'elementor-addon-widgets' ),
|
1292 |
+
'type' => Controls_Manager::DIMENSIONS,
|
1293 |
+
'size_units' => [ 'px', '%' ],
|
1294 |
+
'selectors' => [
|
1295 |
+
'{{WRAPPER}} .obfx-grid-footer a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1296 |
+
],
|
1297 |
+
'condition' => [
|
1298 |
+
'section_grid_content.grid_content_default_btn!' => '',
|
1299 |
+
'section_grid_content.grid_content_product_btn!' => '',
|
1300 |
+
],
|
1301 |
+
]
|
1302 |
+
);
|
1303 |
+
}
|
1304 |
+
|
1305 |
+
/**
|
1306 |
+
* Style > Pagination.
|
1307 |
+
*/
|
1308 |
+
private function grid_pagination_style_section() {
|
1309 |
+
// Tab.
|
1310 |
+
$this->start_controls_section(
|
1311 |
+
'section_grid_pagination_style',
|
1312 |
+
[
|
1313 |
+
'label' => __( 'Pagination', 'elementor-addon-widgets' ),
|
1314 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
1315 |
+
'condition' => [
|
1316 |
+
'section_grid.grid_pagination' => 'yes',
|
1317 |
+
],
|
1318 |
+
]
|
1319 |
+
);
|
1320 |
+
|
1321 |
+
// Image margin.
|
1322 |
+
$this->add_control(
|
1323 |
+
'grid_pagination_style_margin',
|
1324 |
+
[
|
1325 |
+
'label' => __( 'Margin', 'elementor-addon-widgets' ),
|
1326 |
+
'type' => Controls_Manager::DIMENSIONS,
|
1327 |
+
'size_units' => [ 'px' ],
|
1328 |
+
'selectors' => [
|
1329 |
+
'{{WRAPPER}} .obfx-grid-pagination .pagination' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1330 |
+
],
|
1331 |
+
]
|
1332 |
+
);
|
1333 |
+
|
1334 |
+
$this->end_controls_section();
|
1335 |
+
}
|
1336 |
+
|
1337 |
+
/**
|
1338 |
+
* Render function to output the post type grid.
|
1339 |
+
*/
|
1340 |
+
protected function render() {
|
1341 |
+
// Get settings.
|
1342 |
+
$settings = $this->get_settings();
|
1343 |
+
|
1344 |
+
// Output.
|
1345 |
+
echo '<div class="obfx-grid">';
|
1346 |
+
echo '<div class="obfx-grid-container' . ( ! empty( $settings['grid_style'] ) && $settings['grid_style'] == 'list' ? ' obfx-grid-style-' . $settings['grid_style'] : '' ) . ( ! empty( $settings['grid_columns_mobile'] ) ? ' obfx-grid-mobile-' . $settings['grid_columns_mobile'] : '' ) . ( ! empty( $settings['grid_columns_tablet'] ) ? ' obfx-grid-tablet-' . $settings['grid_columns_tablet'] : '' ) . ( ! empty( $settings['grid_columns'] ) ? ' obfx-grid-desktop-' . $settings['grid_columns'] : '' ) . '">';
|
1347 |
+
|
1348 |
+
// Arguments for query.
|
1349 |
+
$args = array();
|
1350 |
+
|
1351 |
+
// Display only published posts.
|
1352 |
+
$args['post_status'] = 'publish';
|
1353 |
+
|
1354 |
+
// Ignore sticky posts.
|
1355 |
+
$args['ignore_sticky_posts'] = 1;
|
1356 |
+
|
1357 |
+
// Check if post type exists.
|
1358 |
+
if ( ! empty( $settings['grid_post_type'] ) && post_type_exists( $settings['grid_post_type'] ) ) {
|
1359 |
+
$args['post_type'] = $settings['grid_post_type'];
|
1360 |
+
}
|
1361 |
+
|
1362 |
+
// Display posts in category.
|
1363 |
+
if ( ! empty( $settings['grid_post_categories'] ) && $settings['grid_post_type'] == 'post' ) {
|
1364 |
+
$args['category_name'] = $settings['grid_post_categories'];
|
1365 |
+
}
|
1366 |
+
|
1367 |
+
// Display products in category.
|
1368 |
+
if ( ! empty( $settings['grid_product_categories'] ) && $settings['grid_post_type'] == 'product' ) {
|
1369 |
+
$args['tax_query'] = array(
|
1370 |
+
'relation' => 'AND',
|
1371 |
+
array(
|
1372 |
+
'taxonomy' => 'product_cat',
|
1373 |
+
'field' => 'slug',
|
1374 |
+
'terms' => $settings['grid_product_categories'],
|
1375 |
+
),
|
1376 |
+
);
|
1377 |
+
}
|
1378 |
+
|
1379 |
+
// Items to display.
|
1380 |
+
if ( ! empty( $settings['grid_items'] ) && intval( $settings['grid_items'] ) == $settings['grid_items'] ) {
|
1381 |
+
$args['posts_per_page'] = $settings['grid_items'];
|
1382 |
+
}
|
1383 |
+
|
1384 |
+
// Order by.
|
1385 |
+
if ( ! empty( $settings['grid_order_by'] ) ) {
|
1386 |
+
$args['orderby'] = $settings['grid_order_by'];
|
1387 |
+
}
|
1388 |
+
|
1389 |
+
// Pagination.
|
1390 |
+
if ( ! empty( $settings['grid_pagination'] ) ) {
|
1391 |
+
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
|
1392 |
+
$args['paged'] = $paged;
|
1393 |
+
}
|
1394 |
+
|
1395 |
+
// Query.
|
1396 |
+
$query = new \WP_Query( $args );
|
1397 |
+
|
1398 |
+
// Query results.
|
1399 |
+
if ( $query->have_posts() ) {
|
1400 |
+
while ( $query->have_posts() ) {
|
1401 |
+
$query->the_post();
|
1402 |
+
|
1403 |
+
echo '<div class="obfx-grid-wrapper">';
|
1404 |
+
echo '<article class="obfx-grid-col' . ( $settings['grid_image_hide'] == 'yes' || ! has_post_thumbnail() ? ' obfx-no-image' : '' ) . '">';
|
1405 |
+
|
1406 |
+
// Image.
|
1407 |
+
$this->renderImage();
|
1408 |
+
|
1409 |
+
echo '<div class="obfx-grid-col-content">';
|
1410 |
+
// Title.
|
1411 |
+
$this->renderTitle();
|
1412 |
+
|
1413 |
+
// Meta.
|
1414 |
+
$this->renderMeta();
|
1415 |
+
|
1416 |
+
// Content.
|
1417 |
+
$this->renderContent();
|
1418 |
+
|
1419 |
+
// Price.
|
1420 |
+
if ( class_exists( 'WooCommerce' ) ) {
|
1421 |
+
$this->renderPrice();
|
1422 |
+
}
|
1423 |
+
|
1424 |
+
// Button.
|
1425 |
+
$this->renderButton();
|
1426 |
+
|
1427 |
+
echo '</div><!-- .obfx-grid-col-content -->';
|
1428 |
+
echo '</article>';
|
1429 |
+
echo '</div>';
|
1430 |
+
|
1431 |
+
} // end while;
|
1432 |
+
|
1433 |
+
// Pagination.
|
1434 |
+
if ( ! empty( $settings['grid_pagination'] ) ) {
|
1435 |
+
?>
|
1436 |
+
<div class="obfx-grid-pagination">
|
1437 |
+
<?php
|
1438 |
+
$big = 999999999;
|
1439 |
+
$totalpages = $query->max_num_pages;
|
1440 |
+
$current = max( 1, $paged );
|
1441 |
+
$paginate_args = array(
|
1442 |
+
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
|
1443 |
+
'format' => '?paged=%#%',
|
1444 |
+
'current' => $current,
|
1445 |
+
'total' => $totalpages,
|
1446 |
+
'show_all' => false,
|
1447 |
+
'end_size' => 1,
|
1448 |
+
'mid_size' => 3,
|
1449 |
+
'prev_next' => true,
|
1450 |
+
'prev_text' => esc_html__( 'Previous', 'elementor-addon-widgets' ),
|
1451 |
+
'next_text' => esc_html__( 'Next', 'elementor-addon-widgets' ),
|
1452 |
+
'type' => 'plain',
|
1453 |
+
'add_args' => false,
|
1454 |
+
);
|
1455 |
+
|
1456 |
+
$pagination = paginate_links( $paginate_args );
|
1457 |
+
?>
|
1458 |
+
<nav class="pagination">
|
1459 |
+
<?php echo $pagination; ?>
|
1460 |
+
</nav>
|
1461 |
+
</div>
|
1462 |
+
<?php
|
1463 |
+
}
|
1464 |
+
} // end if;
|
1465 |
+
|
1466 |
+
// Restore original data.
|
1467 |
+
wp_reset_postdata();
|
1468 |
+
|
1469 |
+
echo '</div><!-- .obfx-grid-container -->';
|
1470 |
+
|
1471 |
+
echo '</div><!-- .obfx-grid -->';
|
1472 |
+
}
|
1473 |
+
|
1474 |
+
/**
|
1475 |
+
* Render image of post type.
|
1476 |
+
*/
|
1477 |
+
protected function renderImage() {
|
1478 |
+
$settings = $this->get_settings();
|
1479 |
+
|
1480 |
+
// Only in editor.
|
1481 |
+
if ( $settings['grid_image_hide'] !== 'yes' ) {
|
1482 |
+
// Check if post type has featured image.
|
1483 |
+
if ( has_post_thumbnail() ) {
|
1484 |
+
|
1485 |
+
if ( $settings['grid_image_link'] == 'yes' ) {
|
1486 |
+
?>
|
1487 |
+
<div class="obfx-grid-col-image">
|
1488 |
+
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
1489 |
+
<?php
|
1490 |
+
the_post_thumbnail(
|
1491 |
+
'full', array(
|
1492 |
+
'class' => 'img-responsive',
|
1493 |
+
'alt' => get_the_title( get_post_thumbnail_id() ),
|
1494 |
+
)
|
1495 |
+
);
|
1496 |
+
?>
|
1497 |
+
</a>
|
1498 |
+
</div>
|
1499 |
+
<?php } else { ?>
|
1500 |
+
<div class="obfx-grid-col-image">
|
1501 |
+
<?php
|
1502 |
+
the_post_thumbnail(
|
1503 |
+
'full', array(
|
1504 |
+
'class' => 'img-responsive',
|
1505 |
+
'alt' => get_the_title( get_post_thumbnail_id() ),
|
1506 |
+
)
|
1507 |
+
);
|
1508 |
+
?>
|
1509 |
+
</div>
|
1510 |
+
<?php
|
1511 |
+
}
|
1512 |
+
}
|
1513 |
+
}
|
1514 |
+
}
|
1515 |
+
|
1516 |
+
/**
|
1517 |
+
* Render title of post type.
|
1518 |
+
*/
|
1519 |
+
protected function renderTitle() {
|
1520 |
+
$settings = $this->get_settings();
|
1521 |
+
|
1522 |
+
if ( $settings['grid_title_hide'] !== 'yes' ) {
|
1523 |
+
?>
|
1524 |
+
<<?php echo $settings['grid_title_tag']; ?> class="entry-title obfx-grid-title">
|
1525 |
+
<?php if ( $settings['grid_title_link'] == 'yes' ) { ?>
|
1526 |
+
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
1527 |
+
<?php
|
1528 |
+
the_title();
|
1529 |
+
?>
|
1530 |
+
</a>
|
1531 |
+
<?php
|
1532 |
+
} else {
|
1533 |
+
the_title();
|
1534 |
+
}
|
1535 |
+
?>
|
1536 |
+
</<?php echo $settings['grid_title_tag']; ?>>
|
1537 |
+
<?php
|
1538 |
+
}
|
1539 |
+
}
|
1540 |
+
|
1541 |
+
/**
|
1542 |
+
* Render meta of post type.
|
1543 |
+
*/
|
1544 |
+
protected function renderMeta() {
|
1545 |
+
$settings = $this->get_settings();
|
1546 |
+
|
1547 |
+
if ( $settings['grid_meta_hide'] !== 'yes' ) {
|
1548 |
+
if ( ! empty( $settings['grid_meta_display'] ) ) {
|
1549 |
+
?>
|
1550 |
+
<div class="entry-meta obfx-grid-meta">
|
1551 |
+
|
1552 |
+
<?php
|
1553 |
+
foreach ( $settings['grid_meta_display'] as $meta ) {
|
1554 |
+
|
1555 |
+
switch ( $meta ) :
|
1556 |
+
// Author
|
1557 |
+
case 'author':
|
1558 |
+
?>
|
1559 |
+
<span class="obfx-grid-author">
|
1560 |
+
<?php
|
1561 |
+
echo ( $settings['grid_meta_remove_icons'] == '' ) ? '<i class="fa fa-user"></i>' : '';
|
1562 |
+
|
1563 |
+
echo get_the_author();
|
1564 |
+
?>
|
1565 |
+
</span>
|
1566 |
+
<?php
|
1567 |
+
// Date
|
1568 |
+
break;
|
1569 |
+
case 'date':
|
1570 |
+
?>
|
1571 |
+
<span class="obfx-grid-date">
|
1572 |
+
<?php
|
1573 |
+
echo ( $settings['grid_meta_remove_icons'] == '' ) ? '<i class="fa fa-calendar"></i>' : '';
|
1574 |
+
|
1575 |
+
echo get_the_date();
|
1576 |
+
?>
|
1577 |
+
</span>
|
1578 |
+
<?php
|
1579 |
+
// Category
|
1580 |
+
break;
|
1581 |
+
case 'category':
|
1582 |
+
$this->metaGridCategories();
|
1583 |
+
|
1584 |
+
// Tags
|
1585 |
+
break;
|
1586 |
+
case 'tags':
|
1587 |
+
$this->metaGridTags();
|
1588 |
+
|
1589 |
+
// Comments/Reviews
|
1590 |
+
break;
|
1591 |
+
case 'comments':
|
1592 |
+
?>
|
1593 |
+
<span class="obfx-grid-comments">
|
1594 |
+
<?php
|
1595 |
+
echo ( $settings['grid_meta_remove_icons'] == '' ) ? '<i class="fa fa-comment"></i>' : '';
|
1596 |
+
|
1597 |
+
if ( $settings['grid_post_type'] == 'product' ) {
|
1598 |
+
echo comments_number( __( 'No reviews', 'elementor-addon-widgets' ), __( '1 review', 'elementor-addon-widgets' ), __( '% reviews', 'elementor-addon-widgets' ) );
|
1599 |
+
} else {
|
1600 |
+
echo comments_number( __( 'No comments', 'elementor-addon-widgets' ), __( '1 comment', 'elementor-addon-widgets' ), __( '% comments', 'elementor-addon-widgets' ) );
|
1601 |
+
}
|
1602 |
+
?>
|
1603 |
+
</span>
|
1604 |
+
<?php
|
1605 |
+
break;
|
1606 |
+
endswitch;
|
1607 |
+
} // end foreach
|
1608 |
+
?>
|
1609 |
+
|
1610 |
+
</div>
|
1611 |
+
<?php
|
1612 |
+
}
|
1613 |
+
}
|
1614 |
+
}
|
1615 |
+
|
1616 |
+
/**
|
1617 |
+
* Display categories in meta section.
|
1618 |
+
*/
|
1619 |
+
protected function metaGridCategories() {
|
1620 |
+
$settings = $this->get_settings();
|
1621 |
+
$post_type_category = get_the_category();
|
1622 |
+
$maxCategories = $settings['grid_meta_categories_max'] ? $settings['grid_meta_categories_max'] : '-1';
|
1623 |
+
$i = 0; // counter
|
1624 |
+
|
1625 |
+
if ( $post_type_category ) {
|
1626 |
+
?>
|
1627 |
+
<span class="obfx-grid-categories">
|
1628 |
+
<?php
|
1629 |
+
echo ( $settings['grid_meta_remove_icons'] == '' ) ? '<i class="fa fa-bookmark"></i>' : '';
|
1630 |
+
|
1631 |
+
foreach ( $post_type_category as $category ) {
|
1632 |
+
if ( $i == $maxCategories ) {
|
1633 |
+
break;
|
1634 |
+
}
|
1635 |
+
?>
|
1636 |
+
<span class="obfx-grid-categories-item"><a
|
1637 |
+
href="<?php echo get_category_link( $category->term_id ); ?>"
|
1638 |
+
title="<?php echo $category->name; ?>"><?php echo $category->name; ?></a></span>
|
1639 |
+
<?php
|
1640 |
+
$i ++;
|
1641 |
+
}
|
1642 |
+
?>
|
1643 |
+
</span>
|
1644 |
+
<?php
|
1645 |
+
}
|
1646 |
+
}
|
1647 |
+
|
1648 |
+
/**
|
1649 |
+
* Display tags in meta section.
|
1650 |
+
*/
|
1651 |
+
protected function metaGridTags() {
|
1652 |
+
$settings = $this->get_settings();
|
1653 |
+
$post_type_tags = get_the_tags();
|
1654 |
+
$maxTags = $settings['grid_meta_tags_max'] ? $settings['grid_meta_tags_max'] : '-1';
|
1655 |
+
$i = 0; // counter
|
1656 |
+
|
1657 |
+
if ( $post_type_tags ) {
|
1658 |
+
?>
|
1659 |
+
<span class="obfx-grid-tags">
|
1660 |
+
<?php
|
1661 |
+
echo ( $settings['grid_meta_remove_icons'] == '' ) ? '<i class="fa fa-tags"></i>' : '';
|
1662 |
+
|
1663 |
+
foreach ( $post_type_tags as $tag ) {
|
1664 |
+
if ( $i == $maxTags ) {
|
1665 |
+
break;
|
1666 |
+
}
|
1667 |
+
?>
|
1668 |
+
<span class="obfx-grid-tags-item"><a href="<?php echo get_tag_link( $tag->term_id ); ?>" title="<?php echo $tag->name; ?>"><?php echo $tag->name; ?></a></span>
|
1669 |
+
<?php
|
1670 |
+
$i ++;
|
1671 |
+
}
|
1672 |
+
?>
|
1673 |
+
</span>
|
1674 |
+
<?php
|
1675 |
+
}
|
1676 |
+
}
|
1677 |
+
|
1678 |
+
/**
|
1679 |
+
* Render content of post type.
|
1680 |
+
*/
|
1681 |
+
protected function renderContent() {
|
1682 |
+
$settings = $this->get_settings();
|
1683 |
+
|
1684 |
+
if ( $settings['grid_content_hide'] !== 'yes' ) {
|
1685 |
+
?>
|
1686 |
+
<div class="entry-content obfx-grid-content">
|
1687 |
+
<?php
|
1688 |
+
if ( empty( $settings['grid_content_length'] ) ) {
|
1689 |
+
the_excerpt();
|
1690 |
+
} else {
|
1691 |
+
echo wp_trim_words( get_the_excerpt(), $settings['grid_content_length'] );
|
1692 |
+
}
|
1693 |
+
?>
|
1694 |
+
</div>
|
1695 |
+
<?php
|
1696 |
+
}
|
1697 |
+
}
|
1698 |
+
|
1699 |
+
/**
|
1700 |
+
* Display price if post type is product.
|
1701 |
+
*/
|
1702 |
+
protected function renderPrice() {
|
1703 |
+
$settings = $this->get_settings();
|
1704 |
+
$product = wc_get_product( get_the_ID() );
|
1705 |
+
|
1706 |
+
if ( $settings['grid_post_type'] == 'product' && $settings['grid_content_price'] == 'yes' ) {
|
1707 |
+
?>
|
1708 |
+
<div class="obfx-grid-price">
|
1709 |
+
<?php
|
1710 |
+
$price = $product->get_price_html();
|
1711 |
+
if ( ! empty( $price ) ) {
|
1712 |
+
echo wp_kses(
|
1713 |
+
$price, array(
|
1714 |
+
'span' => array(
|
1715 |
+
'class' => array(),
|
1716 |
+
),
|
1717 |
+
'del' => array(),
|
1718 |
+
)
|
1719 |
+
);
|
1720 |
+
}
|
1721 |
+
?>
|
1722 |
+
</div>
|
1723 |
+
<?php
|
1724 |
+
}
|
1725 |
+
}
|
1726 |
+
|
1727 |
+
/**
|
1728 |
+
* Render button of post type.
|
1729 |
+
*/
|
1730 |
+
protected function renderButton() {
|
1731 |
+
$settings = $this->get_settings();
|
1732 |
+
|
1733 |
+
if ( $settings['grid_post_type'] == 'product' && $settings['grid_content_product_btn'] == 'yes' ) {
|
1734 |
+
?>
|
1735 |
+
<div class="obfx-grid-footer">
|
1736 |
+
<?php $this->renderAddToCart(); ?>
|
1737 |
+
</div>
|
1738 |
+
<?php } elseif ( $settings['grid_content_default_btn'] == 'yes' && ! empty( $settings['grid_content_default_btn_text'] ) ) { ?>
|
1739 |
+
<div class="obfx-grid-footer">
|
1740 |
+
<a href="<?php echo get_the_permalink(); ?>" title="<?php echo $settings['grid_content_default_btn_text']; ?>"><?php echo $settings['grid_content_default_btn_text']; ?></a>
|
1741 |
+
</div>
|
1742 |
+
<?php
|
1743 |
+
}
|
1744 |
+
}
|
1745 |
+
|
1746 |
+
/**
|
1747 |
+
* Display Add to Cart button.
|
1748 |
+
*/
|
1749 |
+
protected function renderAddToCart() {
|
1750 |
+
$product = wc_get_product( get_the_ID() );
|
1751 |
+
|
1752 |
+
echo apply_filters(
|
1753 |
+
'woocommerce_loop_add_to_cart_link',
|
1754 |
+
sprintf(
|
1755 |
+
'<a href="%s" title="%s" rel="nofollow">%s</a>',
|
1756 |
+
esc_url( $product->add_to_cart_url() ),
|
1757 |
+
esc_attr( $product->add_to_cart_text() ),
|
1758 |
+
esc_html( $product->add_to_cart_text() )
|
1759 |
+
), $product
|
1760 |
+
);
|
1761 |
+
}
|
1762 |
+
}
|
1763 |
+
|
widgets/elementor/pricing-table.php
ADDED
@@ -0,0 +1,1056 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Orbit Fox Elementor Pricing Table Widget
|
4 |
+
*
|
5 |
+
* @link https://themeisle.com
|
6 |
+
* @since 1.0.0
|
7 |
+
*
|
8 |
+
* @package Elementor_Widgets_EAW_Module
|
9 |
+
*/
|
10 |
+
|
11 |
+
namespace Elementor;
|
12 |
+
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
+
} // Exit if accessed directly
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Class EAW_Elementor_Widget_Pricing_Table
|
19 |
+
*
|
20 |
+
* @package Elementor_Widgets_EAW_Module
|
21 |
+
*/
|
22 |
+
class EAW_Elementor_Widget_Pricing_Table extends Widget_Base {
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Widget title.
|
26 |
+
*
|
27 |
+
* @return string
|
28 |
+
*/
|
29 |
+
public function get_title() {
|
30 |
+
return __( 'EAW Pricing Table', 'elementor-addon-widgets' );
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Widget icon.
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function get_icon() {
|
39 |
+
return 'eicon-price-table';
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Widget name.
|
44 |
+
*
|
45 |
+
* @return string
|
46 |
+
*/
|
47 |
+
public function get_name() {
|
48 |
+
return 'obfx-pricing-table';
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Widget Category
|
53 |
+
*
|
54 |
+
* @return array
|
55 |
+
*/
|
56 |
+
public function get_categories() {
|
57 |
+
return [ 'eaw-elementor-widgets' ];
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Register Elementor Controls
|
62 |
+
*/
|
63 |
+
protected function _register_controls() {
|
64 |
+
$this->plan_title_section();
|
65 |
+
|
66 |
+
$this->plan_price_tag_section();
|
67 |
+
|
68 |
+
$this->features_section();
|
69 |
+
|
70 |
+
$this->button_section();
|
71 |
+
|
72 |
+
$this->header_style_section();
|
73 |
+
|
74 |
+
$this->price_tag_style_section();
|
75 |
+
|
76 |
+
$this->features_style_section();
|
77 |
+
|
78 |
+
$this->button_style_section();
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Content > Title section.
|
83 |
+
*/
|
84 |
+
private function plan_title_section() {
|
85 |
+
$this->start_controls_section(
|
86 |
+
'section_title',
|
87 |
+
[
|
88 |
+
'label' => __( 'Plan Title', 'elementor-addon-widgets' ),
|
89 |
+
]
|
90 |
+
);
|
91 |
+
|
92 |
+
$this->add_control(
|
93 |
+
'title',
|
94 |
+
[
|
95 |
+
'type' => Controls_Manager::TEXT,
|
96 |
+
'label' => __( 'Title', 'elementor-addon-widgets' ),
|
97 |
+
'placeholder' => __( 'Title', 'elementor-addon-widgets' ),
|
98 |
+
'default' => __( 'Pricing Plan', 'elementor-addon-widgets' ),
|
99 |
+
]
|
100 |
+
);
|
101 |
+
|
102 |
+
$this->add_control(
|
103 |
+
'title_tag',
|
104 |
+
[
|
105 |
+
'type' => Controls_Manager::SELECT,
|
106 |
+
'label' => __( 'Title HTML tag', 'elementor-addon-widgets' ),
|
107 |
+
'default' => 'h3',
|
108 |
+
'options' => [
|
109 |
+
'h1' => __( 'h1', 'elementor-addon-widgets' ),
|
110 |
+
'h2' => __( 'h2', 'elementor-addon-widgets' ),
|
111 |
+
'h3' => __( 'h3', 'elementor-addon-widgets' ),
|
112 |
+
'h4' => __( 'h4', 'elementor-addon-widgets' ),
|
113 |
+
'h5' => __( 'h5', 'elementor-addon-widgets' ),
|
114 |
+
'h6' => __( 'h6', 'elementor-addon-widgets' ),
|
115 |
+
'p' => __( 'p', 'elementor-addon-widgets' ),
|
116 |
+
],
|
117 |
+
]
|
118 |
+
);
|
119 |
+
|
120 |
+
$this->add_control(
|
121 |
+
'subtitle',
|
122 |
+
[
|
123 |
+
'type' => Controls_Manager::TEXT,
|
124 |
+
'label' => __( 'Subtitle', 'elementor-addon-widgets' ),
|
125 |
+
'placeholder' => __( 'Subtitle', 'elementor-addon-widgets' ),
|
126 |
+
'default' => __( 'Description', 'elementor-addon-widgets' ),
|
127 |
+
]
|
128 |
+
);
|
129 |
+
|
130 |
+
$this->add_control(
|
131 |
+
'subtitle_tag',
|
132 |
+
[
|
133 |
+
'type' => Controls_Manager::SELECT,
|
134 |
+
'label' => __( 'Subtitle HTML Tag', 'elementor-addon-widgets' ),
|
135 |
+
'default' => 'p',
|
136 |
+
'options' => [
|
137 |
+
'h1' => __( 'h1', 'elementor-addon-widgets' ),
|
138 |
+
'h2' => __( 'h2', 'elementor-addon-widgets' ),
|
139 |
+
'h3' => __( 'h3', 'elementor-addon-widgets' ),
|
140 |
+
'h4' => __( 'h4', 'elementor-addon-widgets' ),
|
141 |
+
'h5' => __( 'h5', 'elementor-addon-widgets' ),
|
142 |
+
'h6' => __( 'h6', 'elementor-addon-widgets' ),
|
143 |
+
'p' => __( 'p', 'elementor-addon-widgets' ),
|
144 |
+
],
|
145 |
+
]
|
146 |
+
);
|
147 |
+
$this->end_controls_section(); // end section-title
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Content > Price Tag section.
|
152 |
+
*/
|
153 |
+
private function plan_price_tag_section() {
|
154 |
+
$this->start_controls_section(
|
155 |
+
'section_price_tag',
|
156 |
+
[
|
157 |
+
'label' => __( 'Price Tag', 'elementor-addon-widgets' ),
|
158 |
+
]
|
159 |
+
);
|
160 |
+
|
161 |
+
$this->add_control(
|
162 |
+
'price_tag_text',
|
163 |
+
[
|
164 |
+
'type' => Controls_Manager::TEXT,
|
165 |
+
'label' => __( 'Price', 'elementor-addon-widgets' ),
|
166 |
+
'placeholder' => __( 'Price', 'elementor-addon-widgets' ),
|
167 |
+
'default' => __( '50', 'elementor-addon-widgets' ),
|
168 |
+
'separator' => 'after',
|
169 |
+
]
|
170 |
+
);
|
171 |
+
|
172 |
+
$this->add_control(
|
173 |
+
'price_tag_currency',
|
174 |
+
[
|
175 |
+
'type' => Controls_Manager::TEXT,
|
176 |
+
'label' => __( 'Currency', 'elementor-addon-widgets' ),
|
177 |
+
'placeholder' => __( 'Currency', 'elementor-addon-widgets' ),
|
178 |
+
'default' => __( '$', 'elementor-addon-widgets' ),
|
179 |
+
]
|
180 |
+
);
|
181 |
+
|
182 |
+
$this->add_control(
|
183 |
+
'price_tag_currency_position',
|
184 |
+
[
|
185 |
+
'type' => Controls_Manager::SELECT,
|
186 |
+
'label' => __( 'Currency Position', 'elementor-addon-widgets' ),
|
187 |
+
'default' => 'left',
|
188 |
+
'options' => [
|
189 |
+
'left' => __( 'Before', 'elementor-addon-widgets' ),
|
190 |
+
'right' => __( 'After', 'elementor-addon-widgets' ),
|
191 |
+
],
|
192 |
+
]
|
193 |
+
);
|
194 |
+
|
195 |
+
$this->add_control(
|
196 |
+
'price_tag_period',
|
197 |
+
[
|
198 |
+
'type' => Controls_Manager::TEXT,
|
199 |
+
'label' => __( 'Period', 'elementor-addon-widgets' ),
|
200 |
+
'placeholder' => __( '/month', 'elementor-addon-widgets' ),
|
201 |
+
'default' => __( '/month', 'elementor-addon-widgets' ),
|
202 |
+
'separator' => 'before',
|
203 |
+
]
|
204 |
+
);
|
205 |
+
$this->end_controls_section(); // end section-price-tag
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Content > Features section.
|
210 |
+
*/
|
211 |
+
private function features_section() {
|
212 |
+
$this->start_controls_section(
|
213 |
+
'section_features',
|
214 |
+
[
|
215 |
+
'label' => __( 'Features', 'elementor-addon-widgets' ),
|
216 |
+
]
|
217 |
+
);
|
218 |
+
|
219 |
+
$this->add_control(
|
220 |
+
'feature_list',
|
221 |
+
[
|
222 |
+
'label' => __( 'Plan Features', 'elementor-addon-widgets' ),
|
223 |
+
'type' => Controls_Manager::REPEATER,
|
224 |
+
'default' => [
|
225 |
+
[
|
226 |
+
'accent' => __( 'First', 'elementor-addon-widgets' ),
|
227 |
+
'text' => __( 'Feature', 'elementor-addon-widgets' ),
|
228 |
+
],
|
229 |
+
[
|
230 |
+
'accent' => __( 'Second', 'elementor-addon-widgets' ),
|
231 |
+
'text' => __( 'Feature', 'elementor-addon-widgets' ),
|
232 |
+
],
|
233 |
+
[
|
234 |
+
'accent' => __( 'Third', 'elementor-addon-widgets' ),
|
235 |
+
'text' => __( 'Feature', 'elementor-addon-widgets' ),
|
236 |
+
],
|
237 |
+
],
|
238 |
+
'fields' => [
|
239 |
+
[
|
240 |
+
'type' => Controls_Manager::TEXT,
|
241 |
+
'name' => 'accent',
|
242 |
+
'label' => __( 'Accented Text', 'elementor-addon-widgets' ),
|
243 |
+
'description' => __( 'Appears before feature text', 'elementor-addon-widgets' ),
|
244 |
+
'label_block' => true,
|
245 |
+
'default' => __( 'Accent', 'elementor-addon-widgets' ),
|
246 |
+
],
|
247 |
+
[
|
248 |
+
'type' => Controls_Manager::TEXT,
|
249 |
+
'name' => 'text',
|
250 |
+
'label' => __( 'Text', 'elementor-addon-widgets' ),
|
251 |
+
'label_block' => true,
|
252 |
+
'placeholder' => __( 'Plan Features', 'elementor-addon-widgets' ),
|
253 |
+
'default' => __( 'Feature', 'elementor-addon-widgets' ),
|
254 |
+
],
|
255 |
+
[
|
256 |
+
'type' => Controls_Manager::ICON,
|
257 |
+
'name' => 'feature_icon',
|
258 |
+
'label' => __( 'Icon', 'elementor-addon-widgets' ),
|
259 |
+
'label_block' => true,
|
260 |
+
'default' => 'fa fa-star',
|
261 |
+
],
|
262 |
+
],
|
263 |
+
'title_field' => '{{ accent + " " + text }}',
|
264 |
+
]
|
265 |
+
);
|
266 |
+
|
267 |
+
$this->add_responsive_control(
|
268 |
+
'features_align',
|
269 |
+
[
|
270 |
+
'label' => __( 'Alignment', 'elementor-addon-widgets' ),
|
271 |
+
'type' => Controls_Manager::CHOOSE,
|
272 |
+
'options' => [
|
273 |
+
'left' => [
|
274 |
+
'title' => __( 'Left', 'elementor-addon-widgets' ),
|
275 |
+
'icon' => 'fa fa-align-left',
|
276 |
+
],
|
277 |
+
'center' => [
|
278 |
+
'title' => __( 'Center', 'elementor-addon-widgets' ),
|
279 |
+
'icon' => 'fa fa-align-center',
|
280 |
+
],
|
281 |
+
'right' => [
|
282 |
+
'title' => __( 'Right', 'elementor-addon-widgets' ),
|
283 |
+
'icon' => 'fa fa-align-right',
|
284 |
+
],
|
285 |
+
'justify' => [
|
286 |
+
'title' => __( 'Justified', 'elementor-addon-widgets' ),
|
287 |
+
'icon' => 'fa fa-align-justify',
|
288 |
+
],
|
289 |
+
],
|
290 |
+
'default' => 'center',
|
291 |
+
'selectors' => [
|
292 |
+
'{{WRAPPER}} .obfx-feature-list' => 'text-align: {{VALUE}};',
|
293 |
+
],
|
294 |
+
]
|
295 |
+
);
|
296 |
+
|
297 |
+
$this->end_controls_section(); // end section-features
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Content > Button section.
|
302 |
+
*/
|
303 |
+
private function button_section() {
|
304 |
+
$this->start_controls_section(
|
305 |
+
'section_button',
|
306 |
+
[
|
307 |
+
'label' => __( 'Button', 'elementor-addon-widgets' ),
|
308 |
+
]
|
309 |
+
);
|
310 |
+
|
311 |
+
$this->add_control(
|
312 |
+
'button_text',
|
313 |
+
[
|
314 |
+
'type' => Controls_Manager::TEXT,
|
315 |
+
'label' => __( 'Text', 'elementor-addon-widgets' ),
|
316 |
+
'placeholder' => __( 'Buy Now', 'elementor-addon-widgets' ),
|
317 |
+
'default' => __( 'Buy Now', 'elementor-addon-widgets' ),
|
318 |
+
]
|
319 |
+
);
|
320 |
+
|
321 |
+
$this->add_control(
|
322 |
+
'button_link',
|
323 |
+
[
|
324 |
+
'type' => Controls_Manager::URL,
|
325 |
+
'label' => __( 'Link', 'elementor-addon-widgets' ),
|
326 |
+
'placeholder' => __( 'https://example.com', 'elementor-addon-widgets' ),
|
327 |
+
]
|
328 |
+
);
|
329 |
+
|
330 |
+
$this->add_control(
|
331 |
+
'button_icon',
|
332 |
+
[
|
333 |
+
'type' => Controls_Manager::ICON,
|
334 |
+
'label' => __( 'Icon', 'elementor-addon-widgets' ),
|
335 |
+
'label_block' => true,
|
336 |
+
'default' => '',
|
337 |
+
]
|
338 |
+
);
|
339 |
+
|
340 |
+
$this->add_control(
|
341 |
+
'button_icon_align',
|
342 |
+
[
|
343 |
+
'type' => Controls_Manager::SELECT,
|
344 |
+
'label' => __( 'Icon Position', 'elementor-addon-widgets' ),
|
345 |
+
'default' => 'left',
|
346 |
+
'options' => [
|
347 |
+
'left' => __( 'Before', 'elementor-addon-widgets' ),
|
348 |
+
'right' => __( 'After', 'elementor-addon-widgets' ),
|
349 |
+
],
|
350 |
+
'condition' => [
|
351 |
+
'button_icon!' => '',
|
352 |
+
],
|
353 |
+
]
|
354 |
+
);
|
355 |
+
|
356 |
+
$this->add_control(
|
357 |
+
'button_icon_indent',
|
358 |
+
[
|
359 |
+
'type' => Controls_Manager::SLIDER,
|
360 |
+
'label' => __( 'Icon Spacing', 'elementor-addon-widgets' ),
|
361 |
+
'range' => [
|
362 |
+
'px' => [
|
363 |
+
'max' => 50,
|
364 |
+
],
|
365 |
+
],
|
366 |
+
'condition' => [
|
367 |
+
'button_icon!' => '',
|
368 |
+
],
|
369 |
+
'selectors' => [
|
370 |
+
'{{WRAPPER}} .obfx-button-icon-align-right i' => 'margin-left: {{SIZE}}{{UNIT}};',
|
371 |
+
'{{WRAPPER}} .obfx-button-icon-align-left i' => 'margin-right: {{SIZE}}{{UNIT}};',
|
372 |
+
],
|
373 |
+
]
|
374 |
+
);
|
375 |
+
$this->end_controls_section(); // end section_button
|
376 |
+
}
|
377 |
+
|
378 |
+
/**
|
379 |
+
* Style > Header section.
|
380 |
+
*/
|
381 |
+
private function header_style_section() {
|
382 |
+
$this->start_controls_section(
|
383 |
+
'section_header_style',
|
384 |
+
[
|
385 |
+
'label' => __( 'Header', 'elementor-addon-widgets' ),
|
386 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
387 |
+
]
|
388 |
+
);
|
389 |
+
|
390 |
+
$this->add_responsive_control(
|
391 |
+
'header_padding',
|
392 |
+
[
|
393 |
+
'label' => __( 'Header Padding', 'elementor-addon-widgets' ),
|
394 |
+
'type' => Controls_Manager::DIMENSIONS,
|
395 |
+
'size_units' => [ 'px', 'em', '%' ],
|
396 |
+
'selectors' => [
|
397 |
+
'{{WRAPPER}} .obfx-title-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
398 |
+
],
|
399 |
+
]
|
400 |
+
);
|
401 |
+
|
402 |
+
$this->add_control(
|
403 |
+
'plan_title_color',
|
404 |
+
[
|
405 |
+
'type' => Controls_Manager::COLOR,
|
406 |
+
'label' => __( 'Title Color', 'elementor-addon-widgets' ),
|
407 |
+
'scheme' => [
|
408 |
+
'type' => Scheme_Color::get_type(),
|
409 |
+
'value' => Scheme_Color::COLOR_1,
|
410 |
+
],
|
411 |
+
'default' => '#464959',
|
412 |
+
'selectors' => [
|
413 |
+
'{{WRAPPER}} .obfx-pricing-table-title' => 'color: {{VALUE}};',
|
414 |
+
],
|
415 |
+
]
|
416 |
+
);
|
417 |
+
|
418 |
+
$this->add_group_control(
|
419 |
+
Group_Control_Typography::get_type(),
|
420 |
+
[
|
421 |
+
'name' => 'plan_title_typography',
|
422 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
423 |
+
'selector' => '{{WRAPPER}} .obfx-pricing-table-title',
|
424 |
+
]
|
425 |
+
);
|
426 |
+
|
427 |
+
$this->add_control(
|
428 |
+
'plan_subtitle_color',
|
429 |
+
[
|
430 |
+
'type' => Controls_Manager::COLOR,
|
431 |
+
'label' => __( 'Subtitle Color', 'elementor-addon-widgets' ),
|
432 |
+
'scheme' => [
|
433 |
+
'type' => Scheme_Color::get_type(),
|
434 |
+
'value' => Scheme_Color::COLOR_1,
|
435 |
+
],
|
436 |
+
'default' => '#60647d',
|
437 |
+
'selectors' => [
|
438 |
+
'{{WRAPPER}} .obfx-pricing-table-subtitle' => 'color: {{VALUE}};',
|
439 |
+
],
|
440 |
+
]
|
441 |
+
);
|
442 |
+
|
443 |
+
$this->add_group_control(
|
444 |
+
Group_Control_Typography::get_type(),
|
445 |
+
[
|
446 |
+
'name' => 'plan_subtitle_typography',
|
447 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
448 |
+
'selector' => '{{WRAPPER}} .obfx-pricing-table-subtitle',
|
449 |
+
]
|
450 |
+
);
|
451 |
+
|
452 |
+
$this->add_group_control(
|
453 |
+
Group_Control_Background::get_type(),
|
454 |
+
[
|
455 |
+
'name' => 'heading_section_bg',
|
456 |
+
'label' => __( 'Section Background', 'elementor-addon-widgets' ),
|
457 |
+
'types' => [ 'classic', 'gradient' ],
|
458 |
+
'selector' => '{{WRAPPER}} .obfx-title-wrapper',
|
459 |
+
]
|
460 |
+
);
|
461 |
+
$this->end_controls_section(); // end section_header_style
|
462 |
+
}
|
463 |
+
|
464 |
+
/**
|
465 |
+
* Style > Price Tag section.
|
466 |
+
*/
|
467 |
+
private function price_tag_style_section() {
|
468 |
+
$this->start_controls_section(
|
469 |
+
'section_price_box',
|
470 |
+
[
|
471 |
+
'label' => __( 'Price Tag', 'elementor-addon-widgets' ),
|
472 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
473 |
+
]
|
474 |
+
);
|
475 |
+
|
476 |
+
$this->add_responsive_control(
|
477 |
+
'price_box_padding',
|
478 |
+
[
|
479 |
+
'type' => Controls_Manager::DIMENSIONS,
|
480 |
+
'label' => __( 'Price Box Padding', 'elementor-addon-widgets' ),
|
481 |
+
'size_units' => [ 'px', 'em', '%' ],
|
482 |
+
'selectors' => [
|
483 |
+
'{{WRAPPER}} .obfx-price-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
484 |
+
],
|
485 |
+
]
|
486 |
+
);
|
487 |
+
|
488 |
+
$this->add_group_control(
|
489 |
+
Group_Control_Background::get_type(),
|
490 |
+
[
|
491 |
+
'name' => 'pricing_section_bg',
|
492 |
+
'label' => __( 'Section Background', 'elementor-addon-widgets' ),
|
493 |
+
'types' => [ 'classic', 'gradient' ],
|
494 |
+
'selector' => '{{WRAPPER}} .obfx-price-wrapper',
|
495 |
+
]
|
496 |
+
);
|
497 |
+
|
498 |
+
$this->add_control(
|
499 |
+
'price_tag_heading_currency',
|
500 |
+
[
|
501 |
+
'label' => __( 'Currency', 'elementor-addon-widgets' ),
|
502 |
+
'type' => Controls_Manager::HEADING,
|
503 |
+
'separator' => 'before',
|
504 |
+
]
|
505 |
+
);
|
506 |
+
|
507 |
+
$this->add_control(
|
508 |
+
'currency_color',
|
509 |
+
[
|
510 |
+
'label' => __( 'Currency Color', 'elementor-addon-widgets' ),
|
511 |
+
'type' => Controls_Manager::COLOR,
|
512 |
+
'scheme' => [
|
513 |
+
'type' => Scheme_Color::get_type(),
|
514 |
+
'value' => Scheme_Color::COLOR_1,
|
515 |
+
],
|
516 |
+
'default' => '#60647d',
|
517 |
+
'selectors' => [
|
518 |
+
'{{WRAPPER}} .obfx-price-currency' => 'color: {{VALUE}};',
|
519 |
+
],
|
520 |
+
]
|
521 |
+
);
|
522 |
+
|
523 |
+
$this->add_group_control(
|
524 |
+
Group_Control_Typography::get_type(),
|
525 |
+
[
|
526 |
+
'name' => 'currency_typography',
|
527 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
528 |
+
'selector' => '{{WRAPPER}} .obfx-price-currency',
|
529 |
+
]
|
530 |
+
);
|
531 |
+
|
532 |
+
$this->add_control(
|
533 |
+
'price_tag_heading_price',
|
534 |
+
[
|
535 |
+
'label' => __( 'Price', 'elementor-addon-widgets' ),
|
536 |
+
'type' => Controls_Manager::HEADING,
|
537 |
+
'separator' => 'before',
|
538 |
+
]
|
539 |
+
);
|
540 |
+
|
541 |
+
$this->add_control(
|
542 |
+
'price_text_color',
|
543 |
+
[
|
544 |
+
'label' => __( 'Price Color', 'elementor-addon-widgets' ),
|
545 |
+
'type' => Controls_Manager::COLOR,
|
546 |
+
'scheme' => [
|
547 |
+
'type' => Scheme_Color::get_type(),
|
548 |
+
'value' => Scheme_Color::COLOR_1,
|
549 |
+
],
|
550 |
+
'default' => '#60647d',
|
551 |
+
'selectors' => [
|
552 |
+
'{{WRAPPER}} .obfx-price' => 'color: {{VALUE}};',
|
553 |
+
],
|
554 |
+
]
|
555 |
+
);
|
556 |
+
|
557 |
+
$this->add_group_control(
|
558 |
+
Group_Control_Typography::get_type(),
|
559 |
+
[
|
560 |
+
'name' => 'price_typography',
|
561 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
562 |
+
'selector' => '{{WRAPPER}} .obfx-price',
|
563 |
+
]
|
564 |
+
);
|
565 |
+
|
566 |
+
$this->add_control(
|
567 |
+
'price_tag_heading_period',
|
568 |
+
[
|
569 |
+
'label' => __( 'Period', 'elementor-addon-widgets' ),
|
570 |
+
'type' => Controls_Manager::HEADING,
|
571 |
+
'separator' => 'before',
|
572 |
+
]
|
573 |
+
);
|
574 |
+
|
575 |
+
$this->add_control(
|
576 |
+
'period_color',
|
577 |
+
[
|
578 |
+
'label' => __( 'Period Color', 'elementor-addon-widgets' ),
|
579 |
+
'type' => Controls_Manager::COLOR,
|
580 |
+
'scheme' => [
|
581 |
+
'type' => Scheme_Color::get_type(),
|
582 |
+
'value' => Scheme_Color::COLOR_1,
|
583 |
+
],
|
584 |
+
'default' => '#60647d',
|
585 |
+
'selectors' => [
|
586 |
+
'{{WRAPPER}} .obfx-pricing-period' => 'color: {{VALUE}};',
|
587 |
+
],
|
588 |
+
]
|
589 |
+
);
|
590 |
+
|
591 |
+
$this->add_group_control(
|
592 |
+
Group_Control_Typography::get_type(),
|
593 |
+
[
|
594 |
+
'name' => 'price_sub_text_typography',
|
595 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
596 |
+
'selector' => '{{WRAPPER}} .obfx-pricing-period',
|
597 |
+
]
|
598 |
+
);
|
599 |
+
$this->end_controls_section(); // end pricing-section
|
600 |
+
}
|
601 |
+
|
602 |
+
/**
|
603 |
+
* Style > Features section.
|
604 |
+
*/
|
605 |
+
private function features_style_section() {
|
606 |
+
$this->start_controls_section(
|
607 |
+
'section_features_style',
|
608 |
+
[
|
609 |
+
'label' => __( 'Features', 'elementor-addon-widgets' ),
|
610 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
611 |
+
]
|
612 |
+
);
|
613 |
+
|
614 |
+
$this->add_group_control(
|
615 |
+
Group_Control_Background::get_type(),
|
616 |
+
[
|
617 |
+
'name' => 'features_section_bg',
|
618 |
+
'label' => __( 'Section Background', 'elementor-addon-widgets' ),
|
619 |
+
'types' => [ 'classic', 'gradient' ],
|
620 |
+
'selector' => '{{WRAPPER}} .obfx-feature-list',
|
621 |
+
]
|
622 |
+
);
|
623 |
+
|
624 |
+
$this->add_responsive_control(
|
625 |
+
'features_box_padding',
|
626 |
+
[
|
627 |
+
'type' => Controls_Manager::DIMENSIONS,
|
628 |
+
'label' => __( 'Features List Padding', 'elementor-addon-widgets' ),
|
629 |
+
'size_units' => [ 'px', 'em', '%' ],
|
630 |
+
'selectors' => [
|
631 |
+
'{{WRAPPER}} .obfx-feature-list' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
632 |
+
],
|
633 |
+
]
|
634 |
+
);
|
635 |
+
|
636 |
+
$this->add_control(
|
637 |
+
'features_accented_heading',
|
638 |
+
[
|
639 |
+
'label' => __( 'Accented', 'elementor-addon-widgets' ),
|
640 |
+
'type' => Controls_Manager::HEADING,
|
641 |
+
'separator' => 'before',
|
642 |
+
]
|
643 |
+
);
|
644 |
+
|
645 |
+
$this->add_control(
|
646 |
+
'features_accented_text_color',
|
647 |
+
[
|
648 |
+
'type' => Controls_Manager::COLOR,
|
649 |
+
'label' => __( 'Accented Color', 'elementor-addon-widgets' ),
|
650 |
+
'scheme' => [
|
651 |
+
'type' => Scheme_Color::get_type(),
|
652 |
+
'value' => Scheme_Color::COLOR_1,
|
653 |
+
],
|
654 |
+
'default' => '#60647d',
|
655 |
+
'selectors' => [
|
656 |
+
'{{WRAPPER}} .obfx-pricing-table-accented' => 'color: {{VALUE}};',
|
657 |
+
],
|
658 |
+
]
|
659 |
+
);
|
660 |
+
|
661 |
+
$this->add_group_control(
|
662 |
+
Group_Control_Typography::get_type(),
|
663 |
+
[
|
664 |
+
'name' => 'features_accented_typography',
|
665 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
666 |
+
'selector' => '{{WRAPPER}} .obfx-pricing-table-accented',
|
667 |
+
]
|
668 |
+
);
|
669 |
+
|
670 |
+
$this->add_control(
|
671 |
+
'features_features_heading',
|
672 |
+
[
|
673 |
+
'label' => __( 'Features', 'elementor-addon-widgets' ),
|
674 |
+
'type' => Controls_Manager::HEADING,
|
675 |
+
'separator' => 'before',
|
676 |
+
]
|
677 |
+
);
|
678 |
+
|
679 |
+
$this->add_control(
|
680 |
+
'features_text_color',
|
681 |
+
[
|
682 |
+
'label' => __( 'Features Color', 'elementor-addon-widgets' ),
|
683 |
+
'type' => Controls_Manager::COLOR,
|
684 |
+
'scheme' => [
|
685 |
+
'type' => Scheme_Color::get_type(),
|
686 |
+
'value' => Scheme_Color::COLOR_1,
|
687 |
+
],
|
688 |
+
'default' => '#b1b3c0',
|
689 |
+
'selectors' => [
|
690 |
+
'{{WRAPPER}} .obfx-pricing-table-feature' => 'color: {{VALUE}};',
|
691 |
+
],
|
692 |
+
]
|
693 |
+
);
|
694 |
+
|
695 |
+
$this->add_group_control(
|
696 |
+
Group_Control_Typography::get_type(),
|
697 |
+
[
|
698 |
+
'name' => 'features_features_typography',
|
699 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
700 |
+
'selector' => '{{WRAPPER}} .obfx-pricing-table-feature',
|
701 |
+
]
|
702 |
+
);
|
703 |
+
|
704 |
+
$this->add_control(
|
705 |
+
'features_icons_heading',
|
706 |
+
[
|
707 |
+
'label' => __( 'Icons', 'elementor-addon-widgets' ),
|
708 |
+
'type' => Controls_Manager::HEADING,
|
709 |
+
'separator' => 'before',
|
710 |
+
]
|
711 |
+
);
|
712 |
+
|
713 |
+
$this->add_control(
|
714 |
+
'features_icon_color',
|
715 |
+
[
|
716 |
+
'label' => __( 'Icon Color', 'elementor-addon-widgets' ),
|
717 |
+
'type' => Controls_Manager::COLOR,
|
718 |
+
'scheme' => [
|
719 |
+
'type' => Scheme_Color::get_type(),
|
720 |
+
'value' => Scheme_Color::COLOR_1,
|
721 |
+
],
|
722 |
+
'default' => '#b1b3c0',
|
723 |
+
'selectors' => [
|
724 |
+
'{{WRAPPER}} .obfx-pricing-table-feature-icon' => 'color: {{VALUE}};',
|
725 |
+
],
|
726 |
+
]
|
727 |
+
);
|
728 |
+
|
729 |
+
$this->add_control(
|
730 |
+
'features_icon_indent',
|
731 |
+
[
|
732 |
+
'type' => Controls_Manager::SLIDER,
|
733 |
+
'label' => __( 'Icon Spacing', 'elementor-addon-widgets' ),
|
734 |
+
'default' => [
|
735 |
+
'size' => 5,
|
736 |
+
],
|
737 |
+
'range' => [
|
738 |
+
'px' => [
|
739 |
+
'max' => 50,
|
740 |
+
],
|
741 |
+
],
|
742 |
+
'selectors' => [
|
743 |
+
'{{WRAPPER}} i.obfx-pricing-table-feature-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
|
744 |
+
],
|
745 |
+
]
|
746 |
+
);
|
747 |
+
|
748 |
+
$this->end_controls_section(); // end section_features_style
|
749 |
+
}
|
750 |
+
|
751 |
+
/**
|
752 |
+
* Style > Button section.
|
753 |
+
*/
|
754 |
+
private function button_style_section() {
|
755 |
+
$this->start_controls_section(
|
756 |
+
'section_button_style',
|
757 |
+
[
|
758 |
+
'label' => __( 'Button', 'elementor-addon-widgets' ),
|
759 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
760 |
+
]
|
761 |
+
);
|
762 |
+
|
763 |
+
$this->add_group_control(
|
764 |
+
Group_Control_Background::get_type(), [
|
765 |
+
'name' => 'button_section_bg',
|
766 |
+
'label' => __( 'Section Background', 'elementor-addon-widgets' ),
|
767 |
+
'types' => [ 'classic', 'gradient' ],
|
768 |
+
'selector' => '{{WRAPPER}} .obfx-pricing-table-button-wrapper',
|
769 |
+
]
|
770 |
+
);
|
771 |
+
|
772 |
+
$this->add_group_control(
|
773 |
+
Group_Control_Typography::get_type(),
|
774 |
+
[
|
775 |
+
'name' => 'typography',
|
776 |
+
'label' => __( 'Typography', 'elementor-addon-widgets' ),
|
777 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_4,
|
778 |
+
'selector' => '{{WRAPPER}} .obfx-pricing-table-button-wrapper',
|
779 |
+
]
|
780 |
+
);
|
781 |
+
|
782 |
+
$this->add_control(
|
783 |
+
'border_radius',
|
784 |
+
[
|
785 |
+
'label' => __( 'Border Radius', 'elementor-addon-widgets' ),
|
786 |
+
'type' => Controls_Manager::DIMENSIONS,
|
787 |
+
'size_units' => [ 'px', '%' ],
|
788 |
+
'selectors' => [
|
789 |
+
'{{WRAPPER}} .obfx-pricing-table-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
790 |
+
],
|
791 |
+
]
|
792 |
+
);
|
793 |
+
|
794 |
+
$this->add_control(
|
795 |
+
'text_padding',
|
796 |
+
[
|
797 |
+
'label' => __( 'Padding', 'elementor-addon-widgets' ),
|
798 |
+
'type' => Controls_Manager::DIMENSIONS,
|
799 |
+
'size_units' => [ 'px', 'em', '%' ],
|
800 |
+
'selectors' => [
|
801 |
+
'{{WRAPPER}} .obfx-pricing-table-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
802 |
+
],
|
803 |
+
]
|
804 |
+
);
|
805 |
+
|
806 |
+
// Add the tabbed control.
|
807 |
+
$this->tabbed_button_controls();
|
808 |
+
|
809 |
+
$this->end_controls_section(); // end section_button_style
|
810 |
+
}
|
811 |
+
|
812 |
+
/**
|
813 |
+
* Tabs for the Style > Button section.
|
814 |
+
*/
|
815 |
+
private function tabbed_button_controls() {
|
816 |
+
$this->start_controls_tabs( 'tabs_background' );
|
817 |
+
|
818 |
+
$this->start_controls_tab(
|
819 |
+
'tab_background_normal',
|
820 |
+
[
|
821 |
+
'label' => __( 'Normal', 'elementor-addon-widgets' ),
|
822 |
+
]
|
823 |
+
);
|
824 |
+
|
825 |
+
$this->add_control(
|
826 |
+
'button_text_color',
|
827 |
+
[
|
828 |
+
'type' => Controls_Manager::COLOR,
|
829 |
+
'label' => __( 'Text Color', 'elementor-addon-widgets' ),
|
830 |
+
'scheme' => [
|
831 |
+
'type' => Scheme_Color::get_type(),
|
832 |
+
'value' => Scheme_Color::COLOR_1,
|
833 |
+
],
|
834 |
+
'default' => '#fff',
|
835 |
+
'selectors' => [
|
836 |
+
'{{WRAPPER}} .obfx-pricing-table-button' => 'color: {{VALUE}};',
|
837 |
+
],
|
838 |
+
]
|
839 |
+
);
|
840 |
+
$this->add_control(
|
841 |
+
'button_bg_color',
|
842 |
+
[
|
843 |
+
'type' => Controls_Manager::COLOR,
|
844 |
+
'label' => __( 'Background Color', 'elementor-addon-widgets' ),
|
845 |
+
'scheme' => [
|
846 |
+
'type' => Scheme_Color::get_type(),
|
847 |
+
'value' => Scheme_Color::COLOR_1,
|
848 |
+
],
|
849 |
+
'default' => '#93c64f',
|
850 |
+
'selectors' => [
|
851 |
+
'{{WRAPPER}} .obfx-pricing-table-button' => 'background-color: {{VALUE}};',
|
852 |
+
],
|
853 |
+
]
|
854 |
+
);
|
855 |
+
|
856 |
+
$this->add_group_control(
|
857 |
+
Group_Control_Box_Shadow::get_type(),
|
858 |
+
[
|
859 |
+
'name' => 'button_box_shadow',
|
860 |
+
'selector' => '{{WRAPPER}} .obfx-pricing-table-button',
|
861 |
+
'separator' => '',
|
862 |
+
]
|
863 |
+
);
|
864 |
+
|
865 |
+
$this->end_controls_tab();
|
866 |
+
|
867 |
+
$this->start_controls_tab(
|
868 |
+
'tab_background_hover',
|
869 |
+
[
|
870 |
+
'label' => __( 'Hover', 'elementor-addon-widgets' ),
|
871 |
+
]
|
872 |
+
);
|
873 |
+
|
874 |
+
$this->add_control(
|
875 |
+
'button_hover_text_color',
|
876 |
+
[
|
877 |
+
'type' => Controls_Manager::COLOR,
|
878 |
+
'label' => __( 'Text Color', 'elementor-addon-widgets' ),
|
879 |
+
'scheme' => [
|
880 |
+
'type' => Scheme_Color::get_type(),
|
881 |
+
'value' => Scheme_Color::COLOR_1,
|
882 |
+
],
|
883 |
+
'default' => '#fff',
|
884 |
+
'selectors' => [
|
885 |
+
'{{WRAPPER}} .obfx-pricing-table-button:hover' => 'color: {{VALUE}};',
|
886 |
+
],
|
887 |
+
]
|
888 |
+
);
|
889 |
+
$this->add_control(
|
890 |
+
'button_hover_bg_color',
|
891 |
+
[
|
892 |
+
'type' => Controls_Manager::COLOR,
|
893 |
+
'label' => __( 'Background Color', 'elementor-addon-widgets' ),
|
894 |
+
'scheme' => [
|
895 |
+
'type' => Scheme_Color::get_type(),
|
896 |
+
'value' => Scheme_Color::COLOR_1,
|
897 |
+
],
|
898 |
+
'default' => '#74c600',
|
899 |
+
'selectors' => [
|
900 |
+
'{{WRAPPER}} .obfx-pricing-table-button:hover' => 'background-color: {{VALUE}};',
|
901 |
+
],
|
902 |
+
]
|
903 |
+
);
|
904 |
+
|
905 |
+
$this->add_group_control(
|
906 |
+
Group_Control_Box_Shadow::get_type(),
|
907 |
+
[
|
908 |
+
'name' => 'button_hover_box_shadow',
|
909 |
+
'selector' => '{{WRAPPER}} .obfx-pricing-table-button:hover',
|
910 |
+
'separator' => '',
|
911 |
+
]
|
912 |
+
);
|
913 |
+
|
914 |
+
$this->add_control(
|
915 |
+
'background_hover_transition',
|
916 |
+
[
|
917 |
+
'label' => __( 'Transition Duration', 'elementor-addon-widgets' ),
|
918 |
+
'type' => Controls_Manager::SLIDER,
|
919 |
+
'default' => [
|
920 |
+
'size' => 0.3,
|
921 |
+
],
|
922 |
+
'range' => [
|
923 |
+
'px' => [
|
924 |
+
'max' => 3,
|
925 |
+
'step' => 0.1,
|
926 |
+
],
|
927 |
+
],
|
928 |
+
'render_type' => 'ui',
|
929 |
+
'selectors' => [
|
930 |
+
'{{WRAPPER}} .obfx-pricing-table-button' => 'transition: all {{SIZE}}s ease;',
|
931 |
+
],
|
932 |
+
]
|
933 |
+
);
|
934 |
+
|
935 |
+
$this->end_controls_tab();
|
936 |
+
|
937 |
+
$this->end_controls_tabs();
|
938 |
+
}
|
939 |
+
|
940 |
+
/**
|
941 |
+
* Render function to output the pricing table.
|
942 |
+
*/
|
943 |
+
protected function render() {
|
944 |
+
$settings = $this->get_settings();
|
945 |
+
$this->add_render_attribute( 'title', 'class', 'obfx-pricing-table-title' );
|
946 |
+
$this->add_render_attribute( 'subtitle', 'class', 'obfx-pricing-table-subtitle' );
|
947 |
+
$this->add_render_attribute( 'button', 'class', 'obfx-pricing-table-button' );
|
948 |
+
$this->add_render_attribute( 'button_icon', 'class', $settings['button_icon'] );
|
949 |
+
$this->add_render_attribute( 'button_icon_align', 'class', 'obfx-button-icon-align-' . $settings['button_icon_align'] );
|
950 |
+
if ( ! empty( $settings['link']['url'] ) ) {
|
951 |
+
$this->add_render_attribute( 'button', 'href', $settings['link']['url'] );
|
952 |
+
|
953 |
+
if ( ! empty( $settings['link']['is_external'] ) ) {
|
954 |
+
$this->add_render_attribute( 'button', 'target', '_blank' );
|
955 |
+
}
|
956 |
+
}
|
957 |
+
|
958 |
+
$output = '';
|
959 |
+
|
960 |
+
$output .= '<div class="obfx-pricing-table-wrapper">';
|
961 |
+
|
962 |
+
if ( ! empty( $settings['title'] ) || ! empty( $settings['subtitle'] ) ) {
|
963 |
+
$output .= '<div class="obfx-title-wrapper">';
|
964 |
+
if ( ! empty( $settings['title'] ) ) {
|
965 |
+
// Start of title tag.
|
966 |
+
$output .= '<' . esc_html( $settings['title_tag'] ) . ' ' . $this->get_render_attribute_string( 'title' ) . '>';
|
967 |
+
|
968 |
+
// Title string.
|
969 |
+
$output .= esc_html( $settings['title'] );
|
970 |
+
|
971 |
+
// End of title tag.
|
972 |
+
$output .= '</' . esc_html( $settings['title_tag'] ) . '>';
|
973 |
+
}
|
974 |
+
if ( ! empty( $settings['subtitle'] ) ) {
|
975 |
+
// Start of subtitle tag.
|
976 |
+
$output .= '<' . esc_html( $settings['subtitle_tag'] ) . ' ' . $this->get_render_attribute_string( 'subtitle' ) . '>';
|
977 |
+
|
978 |
+
// Subtitle string.
|
979 |
+
$output .= esc_html( $settings['subtitle'] );
|
980 |
+
|
981 |
+
// End of subtitle tag.
|
982 |
+
$output .= '</' . esc_html( $settings['subtitle_tag'] ) . '>';
|
983 |
+
|
984 |
+
}
|
985 |
+
|
986 |
+
$output .= '</div> <!-- /.obfx-title-wrapper -->';
|
987 |
+
}
|
988 |
+
|
989 |
+
if ( ! empty( $settings['price_tag_text'] ) || ! empty( $settings['price_tag_currency'] ) || ! empty( $settings['price_tag_period'] ) ) {
|
990 |
+
$output .= '<div class="obfx-price-wrapper">';
|
991 |
+
|
992 |
+
if ( ! empty( $settings['price_tag_currency'] ) && ( $settings['price_tag_currency_position'] == 'left' ) ) {
|
993 |
+
$output .= '<span class="obfx-price-currency">' . esc_html( $settings['price_tag_currency'] ) . '</span>';
|
994 |
+
}
|
995 |
+
|
996 |
+
if ( ( isset( $settings['price_tag_text'] ) && $settings['price_tag_text'] === '0' ) || ! empty( $settings['price_tag_text'] ) ) {
|
997 |
+
$output .= '<span class="obfx-price">' . esc_html( $settings['price_tag_text'] ) . '</span>';
|
998 |
+
}
|
999 |
+
|
1000 |
+
if ( ! empty( $settings['price_tag_currency'] ) && ( $settings['price_tag_currency_position'] == 'right' ) ) {
|
1001 |
+
$output .= '<span class="obfx-price-currency">' . esc_html( $settings['price_tag_currency'] ) . '</span>';
|
1002 |
+
}
|
1003 |
+
|
1004 |
+
if ( ! empty( $settings['price_tag_period'] ) ) {
|
1005 |
+
$output .= '<span class="obfx-pricing-period">' . esc_html( $settings['price_tag_period'] ) . '</span>';
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
$output .= '</div> <!-- /.obfx-price-wrapper -->';
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
if ( count( $settings['feature_list'] ) ) {
|
1012 |
+
$output .= '<ul class="obfx-feature-list">';
|
1013 |
+
foreach ( $settings['feature_list'] as $feature ) {
|
1014 |
+
$output .= '<li>';
|
1015 |
+
if ( ! empty( $feature['feature_icon'] ) ) {
|
1016 |
+
$output .= '<i class="obfx-pricing-table-feature-icon ' . esc_attr( $feature['feature_icon'] ) . '"></i>';
|
1017 |
+
}
|
1018 |
+
if ( ! empty( $feature['accent'] ) ) {
|
1019 |
+
$output .= '<span class="obfx-pricing-table-accented">' . esc_html( $feature['accent'] ) . '</span>';
|
1020 |
+
$output .= ' ';
|
1021 |
+
}
|
1022 |
+
if ( ! empty( $feature['text'] ) ) {
|
1023 |
+
$output .= '<span class="obfx-pricing-table-feature">' . esc_html( $feature['text'] ) . '</span>';
|
1024 |
+
}
|
1025 |
+
$output .= '</li>';
|
1026 |
+
}
|
1027 |
+
$output .= '</ul>';
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
if ( ! empty( $settings['button_text'] ) ) {
|
1031 |
+
$output .= '<div class="obfx-pricing-table-button-wrapper">';
|
1032 |
+
|
1033 |
+
$output .= '<a ' . $this->get_render_attribute_string( 'button' ) . '>';
|
1034 |
+
|
1035 |
+
if ( ! empty( $settings['button_icon'] ) && ( $settings['button_icon_align'] == 'left' ) ) {
|
1036 |
+
$output .= '<span ' . $this->get_render_attribute_string( 'button_icon_align' ) . ' >';
|
1037 |
+
$output .= '<i ' . $this->get_render_attribute_string( 'button_icon' ) . '></i>';
|
1038 |
+
}
|
1039 |
+
|
1040 |
+
$output .= '<span class="elementor-button-text">' . esc_html( $settings['button_text'] ) . '</span>';
|
1041 |
+
|
1042 |
+
if ( ! empty( $settings['button_icon'] ) && ( $settings['button_icon_align'] == 'right' ) ) {
|
1043 |
+
$output .= '<span ' . $this->get_render_attribute_string( 'button_icon_align' ) . ' >';
|
1044 |
+
$output .= '<i ' . $this->get_render_attribute_string( 'button_icon' ) . '></i>';
|
1045 |
+
}
|
1046 |
+
|
1047 |
+
$output .= '</a>';
|
1048 |
+
$output .= '</div> <!-- /.obfx-pricing-table-button-wrapper -->';
|
1049 |
+
|
1050 |
+
}
|
1051 |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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Orbit Fox Elementor Services Widget
|
4 |
+
*
|
5 |
+
* @link https://themeisle.com
|
6 |
+
* @since 1.0.0
|
7 |
+
*
|
8 |
+
* @package Elementor_Widgets_EAW_Module
|
9 |
+
*/
|
10 |
+
|
11 |
+
namespace Elementor;
|
12 |
+
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
+
} // Exit if accessed directly
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Class EAW_Elementor_Widget_Services
|
19 |
+
*
|
20 |
+
* @package Elementor_Widgets_EAW_Module
|
21 |
+
*/
|
22 |
+
class EAW_Elementor_Widget_Services extends Widget_Base {
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Widget name.
|
26 |
+
*
|
27 |
+
* @return string
|
28 |
+
*/
|
29 |
+
public function get_name() {
|
30 |
+
return 'obfx-services';
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Widget title.
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function get_title() {
|
39 |
+
return __( 'EAW Services', 'elementor-addon-widgets' );
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Widget icon.
|
44 |
+
*
|
45 |
+
* @return string
|
46 |
+
*/
|
47 |
+
public function get_icon() {
|
48 |
+
return 'fa fa-themeisle';
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Widget Category
|
54 |
+
*
|
55 |
+
* @return array
|
56 |
+
*/
|
57 |
+
public function get_categories() {
|
58 |
+
return [ 'eaw-elementor-widgets' ];
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Register Elementor Controls
|
63 |
+
*/
|
64 |
+
protected function _register_controls() {
|
65 |
+
$this->services_content();
|
66 |
+
$this->style_icon();
|
67 |
+
$this->style_grid_options();
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Content controls
|
72 |
+
*/
|
73 |
+
private function services_content() {
|
74 |
+
$this->start_controls_section(
|
75 |
+
'section_content',
|
76 |
+
[
|
77 |
+
'label' => __( 'Services', 'elementor-addon-widgets' ),
|
78 |
+
]
|
79 |
+
);
|
80 |
+
|
81 |
+
$this->add_control(
|
82 |
+
'services_list',
|
83 |
+
[
|
84 |
+
'label' => __( 'Services', 'elementor-addon-widgets' ),
|
85 |
+
'type' => Controls_Manager::REPEATER,
|
86 |
+
'default' => [
|
87 |
+
[
|
88 |
+
'title' => __( 'Responsive', 'elementor-addon-widgets' ),
|
89 |
+
'text' => __( 'A lot of text here', 'elementor-addon-widgets' ),
|
90 |
+
'icon' => 'fa fa-star',
|
91 |
+
'color' => '#333333',
|
92 |
+
],
|
93 |
+
[
|
94 |
+
'title' => __( 'Responsive', 'elementor-addon-widgets' ),
|
95 |
+
'text' => __( 'A lot of text here', 'elementor-addon-widgets' ),
|
96 |
+
'icon' => 'fa fa-star',
|
97 |
+
'color' => '#333333',
|
98 |
+
],
|
99 |
+
[
|
100 |
+
'title' => __( 'Responsive', 'elementor-addon-widgets' ),
|
101 |
+
'text' => __( 'A lot of text here', 'elementor-addon-widgets' ),
|
102 |
+
'icon' => 'fa fa-star',
|
103 |
+
'color' => '#333333',
|
104 |
+
],
|
105 |
+
],
|
106 |
+
'fields' => [
|
107 |
+
[
|
108 |
+
'type' => Controls_Manager::TEXT,
|
109 |
+
'name' => 'title',
|
110 |
+
'label_block' => true,
|
111 |
+
'label' => __( 'Title & Description', 'elementor-addon-widgets' ),
|
112 |
+
'default' => __( 'Service Title', 'elementor-addon-widgets' ),
|
113 |
+
],
|
114 |
+
[
|
115 |
+
'type' => Controls_Manager::TEXTAREA,
|
116 |
+
'name' => 'text',
|
117 |
+
'placeholder' => __( 'Plan Features', 'elementor-addon-widgets' ),
|
118 |
+
'default' => __( 'Feature', 'elementor-addon-widgets' ),
|
119 |
+
],
|
120 |
+
[
|
121 |
+
'type' => Controls_Manager::ICON,
|
122 |
+
'name' => 'icon',
|
123 |
+
'label' => __( 'Icon', 'elementor-addon-widgets' ),
|
124 |
+
'default' => 'fa fa-star',
|
125 |
+
],
|
126 |
+
[
|
127 |
+
'type' => Controls_Manager::COLOR,
|
128 |
+
'name' => 'color',
|
129 |
+
'label_block' => false,
|
130 |
+
'label' => __( 'Icon Color', 'elementor-addon-widgets' ),
|
131 |
+
'default' => '#5764c6',
|
132 |
+
],
|
133 |
+
[
|
134 |
+
'type' => Controls_Manager::URL,
|
135 |
+
'name' => 'link',
|
136 |
+
'label' => __( 'Link to', 'elementor-addon-widgets' ),
|
137 |
+
'separator' => 'before',
|
138 |
+
'placeholder' => __( 'https://example.com', 'elementor-addon-widgets' ),
|
139 |
+
],
|
140 |
+
],
|
141 |
+
'title_field' => '<i style="color:{{color}}" class="{{icon}}"></i> {{title}}',
|
142 |
+
]
|
143 |
+
);
|
144 |
+
|
145 |
+
$this->add_control(
|
146 |
+
'align',
|
147 |
+
[
|
148 |
+
'label' => '<i class="fa fa-arrows"></i> ' . __( 'Icon Position', 'elementor-addon-widgets' ),
|
149 |
+
'type' => Controls_Manager::CHOOSE,
|
150 |
+
'options' => [
|
151 |
+
'left' => [
|
152 |
+
'title' => __( 'Left', 'elementor-addon-widgets' ),
|
153 |
+
'icon' => 'fa fa-angle-left',
|
154 |
+
],
|
155 |
+
'top' => [
|
156 |
+
'title' => __( 'Top', 'elementor-addon-widgets' ),
|
157 |
+
'icon' => 'fa fa-angle-up',
|
158 |
+
],
|
159 |
+
'right' => [
|
160 |
+
'title' => __( 'Right', 'elementor-addon-widgets' ),
|
161 |
+
'icon' => 'fa fa-angle-right',
|
162 |
+
],
|
163 |
+
],
|
164 |
+
'default' => 'top',
|
165 |
+
'prefix_class' => 'obfx-position-',
|
166 |
+
'toggle' => false,
|
167 |
+
]
|
168 |
+
);
|
169 |
+
|
170 |
+
// Columns.
|
171 |
+
$this->add_responsive_control(
|
172 |
+
'grid_columns',
|
173 |
+
[
|
174 |
+
'type' => Controls_Manager::SELECT,
|
175 |
+
'label' => '<i class="fa fa-columns"></i> ' . __( 'Columns', 'elementor-addon-widgets' ),
|
176 |
+
'default' => 3,
|
177 |
+
'tablet_default' => 2,
|
178 |
+
'mobile_default' => 1,
|
179 |
+
'options' => [
|
180 |
+
1 => 1,
|
181 |
+
2 => 2,
|
182 |
+
3 => 3,
|
183 |
+
4 => 4,
|
184 |
+
5 => 5,
|
185 |
+
],
|
186 |
+
]
|
187 |
+
);
|
188 |
+
$this->end_controls_section();
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Icon Style Controls
|
193 |
+
*/
|
194 |
+
private function style_icon() {
|
195 |
+
$this->start_controls_section(
|
196 |
+
'section_style_icon',
|
197 |
+
[
|
198 |
+
'label' => __( 'Icon', 'elementor-addon-widgets' ),
|
199 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
200 |
+
]
|
201 |
+
);
|
202 |
+
$this->add_control(
|
203 |
+
'icon_space',
|
204 |
+
[
|
205 |
+
'label' => __( 'Spacing', 'elementor-addon-widgets' ),
|
206 |
+
'type' => Controls_Manager::SLIDER,
|
207 |
+
'default' => [
|
208 |
+
'size' => 15,
|
209 |
+
],
|
210 |
+
'range' => [
|
211 |
+
'px' => [
|
212 |
+
'min' => 0,
|
213 |
+
'max' => 300,
|
214 |
+
],
|
215 |
+
],
|
216 |
+
'selectors' => [
|
217 |
+
'{{WRAPPER}}.obfx-position-right .obfx-icon' => 'margin-left: {{SIZE}}{{UNIT}};',
|
218 |
+
'{{WRAPPER}}.obfx-position-left .obfx-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
|
219 |
+
'{{WRAPPER}}.obfx-position-top .obfx-icon' => 'margin-bottom: {{SIZE}}{{UNIT}};',
|
220 |
+
],
|
221 |
+
]
|
222 |
+
);
|
223 |
+
$this->add_control(
|
224 |
+
'icon_size',
|
225 |
+
[
|
226 |
+
'label' => __( 'Size', 'elementor-addon-widgets' ),
|
227 |
+
'type' => Controls_Manager::SLIDER,
|
228 |
+
'range' => [
|
229 |
+
'px' => [
|
230 |
+
'min' => 6,
|
231 |
+
'max' => 300,
|
232 |
+
],
|
233 |
+
],
|
234 |
+
'default' => [
|
235 |
+
'size' => 35,
|
236 |
+
],
|
237 |
+
'selectors' => [
|
238 |
+
'{{WRAPPER}} .obfx-icon' => 'font-size: {{SIZE}}{{UNIT}};',
|
239 |
+
],
|
240 |
+
]
|
241 |
+
);
|
242 |
+
$this->end_controls_section();
|
243 |
+
$this->start_controls_section(
|
244 |
+
'section_style_content',
|
245 |
+
[
|
246 |
+
'label' => __( 'Content', 'elementor-addon-widgets' ),
|
247 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
248 |
+
]
|
249 |
+
);
|
250 |
+
|
251 |
+
$this->add_responsive_control(
|
252 |
+
'text_align',
|
253 |
+
[
|
254 |
+
'label' => __( 'Alignment', 'elementor-addon-widgets' ),
|
255 |
+
'type' => Controls_Manager::CHOOSE,
|
256 |
+
'toggle' => false,
|
257 |
+
'default' => 'center',
|
258 |
+
'options' => [
|
259 |
+
'left' => [
|
260 |
+
'title' => __( 'Left', 'elementor-addon-widgets' ),
|
261 |
+
'icon' => 'fa fa-align-left',
|
262 |
+
],
|
263 |
+
'center' => [
|
264 |
+
'title' => __( 'Center', 'elementor-addon-widgets' ),
|
265 |
+
'icon' => 'fa fa-align-center',
|
266 |
+
],
|
267 |
+
'right' => [
|
268 |
+
'title' => __( 'Right', 'elementor-addon-widgets' ),
|
269 |
+
'icon' => 'fa fa-align-right',
|
270 |
+
],
|
271 |
+
],
|
272 |
+
'selectors' => [
|
273 |
+
'{{WRAPPER}} .obfx-grid .obfx-grid-container .obfx-grid-wrapper .obfx-service-box' => 'text-align: {{VALUE}};',
|
274 |
+
'{{WRAPPER}} .obfx-grid .obfx-grid-container .obfx-grid-wrapper .obfx-service-box .obfx-service-text' => 'text-align: {{VALUE}};',
|
275 |
+
],
|
276 |
+
]
|
277 |
+
);
|
278 |
+
|
279 |
+
$this->add_control(
|
280 |
+
'heading_title',
|
281 |
+
[
|
282 |
+
'label' => __( 'Title', 'elementor-addon-widgets' ),
|
283 |
+
'type' => Controls_Manager::HEADING,
|
284 |
+
'separator' => 'before',
|
285 |
+
]
|
286 |
+
);
|
287 |
+
|
288 |
+
$this->add_responsive_control(
|
289 |
+
'title_bottom_space',
|
290 |
+
[
|
291 |
+
'label' => __( 'Spacing', 'elementor-addon-widgets' ),
|
292 |
+
'type' => Controls_Manager::SLIDER,
|
293 |
+
'range' => [
|
294 |
+
'px' => [
|
295 |
+
'min' => 0,
|
296 |
+
'max' => 300,
|
297 |
+
],
|
298 |
+
],
|
299 |
+
'selectors' => [
|
300 |
+
'{{WRAPPER}} .obfx-service-title' => 'margin-bottom: {{SIZE}}{{UNIT}};',
|
301 |
+
],
|
302 |
+
]
|
303 |
+
);
|
304 |
+
|
305 |
+
$this->add_control(
|
306 |
+
'title_color',
|
307 |
+
[
|
308 |
+
'label' => __( 'Color', 'elementor-addon-widgets' ),
|
309 |
+
'type' => Controls_Manager::COLOR,
|
310 |
+
'default' => '',
|
311 |
+
'selectors' => [
|
312 |
+
'{{WRAPPER}} .obfx-service-title' => 'color: {{VALUE}};',
|
313 |
+
],
|
314 |
+
]
|
315 |
+
);
|
316 |
+
|
317 |
+
$this->add_group_control(
|
318 |
+
Group_Control_Typography::get_type(),
|
319 |
+
[
|
320 |
+
'name' => 'title_typography',
|
321 |
+
'selector' => '{{WRAPPER}} .obfx-service-title',
|
322 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
323 |
+
]
|
324 |
+
);
|
325 |
+
|
326 |
+
$this->add_control(
|
327 |
+
'heading_description',
|
328 |
+
[
|
329 |
+
'label' => __( 'Description', 'elementor-addon-widgets' ),
|
330 |
+
'type' => Controls_Manager::HEADING,
|
331 |
+
'separator' => 'before',
|
332 |
+
]
|
333 |
+
);
|
334 |
+
|
335 |
+
$this->add_control(
|
336 |
+
'description_color',
|
337 |
+
[
|
338 |
+
'label' => __( 'Color', 'elementor-addon-widgets' ),
|
339 |
+
'type' => Controls_Manager::COLOR,
|
340 |
+
'default' => '',
|
341 |
+
'selectors' => [
|
342 |
+
'{{WRAPPER}} .obfx-service-text' => 'color: {{VALUE}};',
|
343 |
+
],
|
344 |
+
'scheme' => [
|
345 |
+
'type' => Scheme_Color::get_type(),
|
346 |
+
'value' => Scheme_Color::COLOR_3,
|
347 |
+
],
|
348 |
+
]
|
349 |
+
);
|
350 |
+
|
351 |
+
$this->add_group_control(
|
352 |
+
Group_Control_Typography::get_type(),
|
353 |
+
[
|
354 |
+
'name' => 'description_typography',
|
355 |
+
'selector' => '{{WRAPPER}} .obfx-service-text',
|
356 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_3,
|
357 |
+
]
|
358 |
+
);
|
359 |
+
|
360 |
+
$this->end_controls_section();
|
361 |
+
}
|
362 |
+
|
363 |
+
/**
|
364 |
+
* Grid Style Controls
|
365 |
+
*/
|
366 |
+
private function style_grid_options() {
|
367 |
+
$this->start_controls_section(
|
368 |
+
'section_grid_style',
|
369 |
+
[
|
370 |
+
'label' => __( 'Grid', 'elementor-addon-widgets' ),
|
371 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
372 |
+
]
|
373 |
+
);
|
374 |
+
|
375 |
+
// Columns margin.
|
376 |
+
$this->add_control(
|
377 |
+
'grid_style_columns_margin',
|
378 |
+
[
|
379 |
+
'label' => __( 'Columns margin', 'elementor-addon-widgets' ),
|
380 |
+
'type' => Controls_Manager::SLIDER,
|
381 |
+
'default' => [
|
382 |
+
'size' => 15,
|
383 |
+
],
|
384 |
+
'range' => [
|
385 |
+
'px' => [
|
386 |
+
'min' => 0,
|
387 |
+
'max' => 100,
|
388 |
+
],
|
389 |
+
],
|
390 |
+
'selectors' => [
|
391 |
+
'{{WRAPPER}} .obfx-grid-wrapper' => 'padding-right: calc( {{SIZE}}{{UNIT}} ); padding-left: calc( {{SIZE}}{{UNIT}} );',
|
392 |
+
'{{WRAPPER}} .obfx-grid-container' => 'margin-left: calc( -{{SIZE}}{{UNIT}} ); margin-right: calc( -{{SIZE}}{{UNIT}} );',
|
393 |
+
],
|
394 |
+
]
|
395 |
+
);
|
396 |
+
|
397 |
+
// Row margin.
|
398 |
+
$this->add_control(
|
399 |
+
'grid_style_rows_margin',
|
400 |
+
[
|
401 |
+
'label' => __( 'Rows margin', 'elementor-addon-widgets' ),
|
402 |
+
'type' => Controls_Manager::SLIDER,
|
403 |
+
'default' => [
|
404 |
+
'size' => 30,
|
405 |
+
],
|
406 |
+
'range' => [
|
407 |
+
'px' => [
|
408 |
+
'min' => 0,
|
409 |
+
'max' => 100,
|
410 |
+
],
|
411 |
+
],
|
412 |
+
'selectors' => [
|
413 |
+
'{{WRAPPER}} .obfx-grid-wrapper' => 'padding-bottom: {{SIZE}}{{UNIT}};',
|
414 |
+
],
|
415 |
+
]
|
416 |
+
);
|
417 |
+
|
418 |
+
// Background.
|
419 |
+
$this->add_group_control(
|
420 |
+
Group_Control_Background::get_type(),
|
421 |
+
[
|
422 |
+
'name' => 'grid_style_background',
|
423 |
+
'types' => [ 'classic', 'gradient' ],
|
424 |
+
'selector' => '{{WRAPPER}} .obfx-grid',
|
425 |
+
]
|
426 |
+
);
|
427 |
+
|
428 |
+
// Items options.
|
429 |
+
$this->add_control(
|
430 |
+
'grid_items_style_heading',
|
431 |
+
[
|
432 |
+
'label' => __( 'Items', 'elementor-addon-widgets' ),
|
433 |
+
'type' => Controls_Manager::HEADING,
|
434 |
+
'separator' => 'before',
|
435 |
+
]
|
436 |
+
);
|
437 |
+
|
438 |
+
// Items internal padding.
|
439 |
+
$this->add_control(
|
440 |
+
'grid_items_style_padding',
|
441 |
+
[
|
442 |
+
'label' => __( 'Padding', 'elementor-addon-widgets' ),
|
443 |
+
'type' => Controls_Manager::DIMENSIONS,
|
444 |
+
'size_units' => [ 'px', '%' ],
|
445 |
+
'selectors' => [
|
446 |
+
'{{WRAPPER}} .obfx-grid-col' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
447 |
+
],
|
448 |
+
]
|
449 |
+
);
|
450 |
+
|
451 |
+
// Items border radius.
|
452 |
+
$this->add_control(
|
453 |
+
'grid_items_style_border_radius',
|
454 |
+
[
|
455 |
+
'label' => __( 'Border Radius', 'elementor-addon-widgets' ),
|
456 |
+
'type' => Controls_Manager::DIMENSIONS,
|
457 |
+
'size_units' => [ 'px', '%' ],
|
458 |
+
'selectors' => [
|
459 |
+
'{{WRAPPER}} .obfx-grid-col' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
460 |
+
],
|
461 |
+
]
|
462 |
+
);
|
463 |
+
|
464 |
+
$this->items_style_tabs();
|
465 |
+
$this->end_controls_section();
|
466 |
+
}
|
467 |
+
|
468 |
+
/**
|
469 |
+
* Items Style Controls
|
470 |
+
*/
|
471 |
+
private function items_style_tabs() {
|
472 |
+
$this->start_controls_tabs( 'tabs_background' );
|
473 |
+
|
474 |
+
$this->start_controls_tab(
|
475 |
+
'tab_background_normal',
|
476 |
+
[
|
477 |
+
'label' => __( 'Normal', 'elementor-addon-widgets' ),
|
478 |
+
]
|
479 |
+
);
|
480 |
+
|
481 |
+
$this->add_group_control(
|
482 |
+
Group_Control_Background::get_type(),
|
483 |
+
[
|
484 |
+
'name' => 'grid_items_background',
|
485 |
+
'types' => [ 'classic', 'gradient' ],
|
486 |
+
'selector' => '{{WRAPPER}} .obfx-service-box',
|
487 |
+
]
|
488 |
+
);
|
489 |
+
|
490 |
+
$this->add_group_control(
|
491 |
+
Group_Control_Box_Shadow::get_type(),
|
492 |
+
[
|
493 |
+
'name' => 'grid_items_box_shadow',
|
494 |
+
'selector' => '{{WRAPPER}} .obfx-service-box',
|
495 |
+
]
|
496 |
+
);
|
497 |
+
|
498 |
+
$this->end_controls_tab();
|
499 |
+
|
500 |
+
$this->start_controls_tab(
|
501 |
+
'tab_background_hover',
|
502 |
+
[
|
503 |
+
'label' => __( 'Hover', 'elementor-addon-widgets' ),
|
504 |
+
]
|
505 |
+
);
|
506 |
+
|
507 |
+
$this->add_group_control(
|
508 |
+
Group_Control_Background::get_type(),
|
509 |
+
[
|
510 |
+
'name' => 'grid_items_background_hover',
|
511 |
+
'types' => [ 'classic', 'gradient' ],
|
512 |
+
'selector' => '{{WRAPPER}} .obfx-service-box:hover',
|
513 |
+
]
|
514 |
+
);
|
515 |
+
|
516 |
+
$this->add_group_control(
|
517 |
+
Group_Control_Box_Shadow::get_type(),
|
518 |
+
[
|
519 |
+
'name' => 'grid_items_box_shadow_hover',
|
520 |
+
'selector' => '{{WRAPPER}} .obfx-service-box:hover',
|
521 |
+
]
|
522 |
+
);
|
523 |
+
|
524 |
+
$this->add_control(
|
525 |
+
'hover_transition',
|
526 |
+
[
|
527 |
+
'label' => __( 'Transition Duration', 'elementor-addon-widgets' ),
|
528 |
+
'type' => Controls_Manager::SLIDER,
|
529 |
+
'default' => [
|
530 |
+
'size' => 0.3,
|
531 |
+
],
|
532 |
+
'range' => [
|
533 |
+
'px' => [
|
534 |
+
'max' => 3,
|
535 |
+
'step' => 0.1,
|
536 |
+
],
|
537 |
+
],
|
538 |
+
'selectors' => [
|
539 |
+
'{{WRAPPER}} .obfx-service-box' => 'transition: all {{SIZE}}s ease;',
|
540 |
+
],
|
541 |
+
]
|
542 |
+
);
|
543 |
+
$this->end_controls_tab();
|
544 |
+
|
545 |
+
$this->end_controls_tabs();
|
546 |
+
}
|
547 |
+
|
548 |
+
/**
|
549 |
+
* Render function to output the pricing table.
|
550 |
+
*/
|
551 |
+
protected function render() {
|
552 |
+
$settings = $this->get_settings();
|
553 |
+
|
554 |
+
echo '<div class="obfx-grid"><div class="obfx-grid-container' . ( ! empty( $settings['grid_columns_mobile'] ) ? ' obfx-grid-mobile-' . $settings['grid_columns_mobile'] : '' ) . ( ! empty( $settings['grid_columns_tablet'] ) ? ' obfx-grid-tablet-' . $settings['grid_columns_tablet'] : '' ) . ( ! empty( $settings['grid_columns'] ) ? ' obfx-grid-desktop-' . $settings['grid_columns'] : '' ) . '">';
|
555 |
+
foreach ( $settings['services_list'] as $service ) {
|
556 |
+
$icon_tag = 'span';
|
557 |
+
|
558 |
+
if ( ! empty( $service['link']['url'] ) ) {
|
559 |
+
$this->add_render_attribute( 'link', 'href', $settings['link']['url'] );
|
560 |
+
$icon_tag = 'a';
|
561 |
+
|
562 |
+
if ( $service['link']['is_external'] ) {
|
563 |
+
$this->add_render_attribute( 'link', 'target', '_blank' );
|
564 |
+
}
|
565 |
+
|
566 |
+
if ( $service['link']['nofollow'] ) {
|
567 |
+
$this->add_render_attribute( 'link', 'rel', 'nofollow' );
|
568 |
+
}
|
569 |
+
} ?>
|
570 |
+
<div class="obfx-grid-wrapper">
|
571 |
+
<?php
|
572 |
+
if ( ! empty( $service['link']['url'] ) ) {
|
573 |
+
$link_props = ' href="' . esc_url( $service['link']['url'] ) . '" ';
|
574 |
+
if ( $service['link']['is_external'] === 'on' ) {
|
575 |
+
$link_props .= ' target="_blank" ';
|
576 |
+
}
|
577 |
+
if ( $service['link']['nofollow'] === 'on' ) {
|
578 |
+
$link_props .= ' rel="nofollow" ';
|
579 |
+
}
|
580 |
+
echo '<a' . $link_props . '>';
|
581 |
+
}
|
582 |
+
?>
|
583 |
+
<div class="obfx-service-box obfx-grid-col">
|
584 |
+
<?php
|
585 |
+
if ( ! empty( $service['icon'] ) ) {
|
586 |
+
?>
|
587 |
+
<span class="obfx-icon-wrap"><i class="obfx-icon <?php echo esc_attr( $service['icon'] ); ?>" style="color: <?php echo esc_attr( $service['color'] ); ?>"></i></span>
|
588 |
+
<?php
|
589 |
+
}
|
590 |
+
if ( ! empty( $service['title'] ) || ! empty( $service['text'] ) ) {
|
591 |
+
?>
|
592 |
+
<div class="obfx-service-box-content">
|
593 |
+
<?php if ( ! empty( $service['title'] ) ) { ?>
|
594 |
+
<h4 class="obfx-service-title"><?php echo esc_attr( $service['title'] ); ?></h4>
|
595 |
+
<?php
|
596 |
+
}
|
597 |
+
if ( ! empty( $service['text'] ) ) {
|
598 |
+
?>
|
599 |
+
<p class="obfx-service-text"><?php echo esc_attr( $service['text'] ); ?></p>
|
600 |
+
<?php } ?>
|
601 |
+
</div><!-- /.obfx-service-box-content -->
|
602 |
+
<?php } ?>
|
603 |
+
</div><!-- /.obfx-service-box -->
|
604 |
+
<?php
|
605 |
+
if ( ! empty( $service['link'] ) ) {
|
606 |
+
echo '</a>';
|
607 |
+
}
|
608 |
+
?>
|
609 |
+
</div><!-- /.obfx-grid-wrapper -->
|
610 |
+
<?php
|
611 |
+
}
|
612 |
+
echo '</div></div>';
|
613 |
+
|
614 |
+
}
|
615 |
+
}
|
widgets/woo/best-products.php
CHANGED
@@ -9,17 +9,17 @@ class Woo_Best_Products extends WP_Widget {
|
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
-
'classname'
|
13 |
-
'description'
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
17 |
parent::__construct( 'woo-best-products', __( 'Woo Best Selling Products', 'elementor-addon-widgets' ), $widget_ops );
|
18 |
$this->alt_option_name = 'woo_best_products';
|
19 |
|
20 |
-
add_action( 'save_post', array($this, 'flush_widget_cache') );
|
21 |
-
add_action( 'deleted_post', array($this, 'flush_widget_cache') );
|
22 |
-
add_action( 'switch_theme', array($this, 'flush_widget_cache') );
|
23 |
}
|
24 |
|
25 |
/**
|
@@ -42,6 +42,7 @@ class Woo_Best_Products extends WP_Widget {
|
|
42 |
|
43 |
if ( isset( $cache[ $args['widget_id'] ] ) ) {
|
44 |
echo $cache[ $args['widget_id'] ];
|
|
|
45 |
return;
|
46 |
}
|
47 |
|
@@ -66,30 +67,29 @@ class Woo_Best_Products extends WP_Widget {
|
|
66 |
|
67 |
$args = apply_filters(
|
68 |
'elementor-addon-widgets_product_categories_args', array(
|
69 |
-
'limit'
|
70 |
-
'columns'
|
71 |
-
'title'
|
72 |
-
|
|
|
73 |
)
|
74 |
);
|
75 |
-
|
76 |
echo $args['before_widget'];
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
'
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
echo '</section>';
|
93 |
// echo '</div>';
|
94 |
echo $args['after_widget'];
|
95 |
|
@@ -102,9 +102,9 @@ class Woo_Best_Products extends WP_Widget {
|
|
102 |
}
|
103 |
|
104 |
public function update( $new_instance, $old_instance ) {
|
105 |
-
$instance
|
106 |
-
$instance['title']
|
107 |
-
$instance['limit']
|
108 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
109 |
$this->flush_widget_cache();
|
110 |
|
@@ -127,20 +127,29 @@ class Woo_Best_Products extends WP_Widget {
|
|
127 |
* @param array $instance
|
128 |
*/
|
129 |
public function form( $instance ) {
|
130 |
-
$title
|
131 |
-
$limit
|
132 |
-
$columns
|
133 |
-
|
134 |
-
<p
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
<p
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
}
|
146 |
}
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
+
'classname' => 'woo_best_products',
|
13 |
+
'description' => __( 'Woo Best Selling Products - designed for use with the Elementor Page Builder plugin', 'elementor-addon-widgets' ),
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
17 |
parent::__construct( 'woo-best-products', __( 'Woo Best Selling Products', 'elementor-addon-widgets' ), $widget_ops );
|
18 |
$this->alt_option_name = 'woo_best_products';
|
19 |
|
20 |
+
add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
|
21 |
+
add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
|
22 |
+
add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
|
23 |
}
|
24 |
|
25 |
/**
|
42 |
|
43 |
if ( isset( $cache[ $args['widget_id'] ] ) ) {
|
44 |
echo $cache[ $args['widget_id'] ];
|
45 |
+
|
46 |
return;
|
47 |
}
|
48 |
|
67 |
|
68 |
$args = apply_filters(
|
69 |
'elementor-addon-widgets_product_categories_args', array(
|
70 |
+
'limit' => $limit,
|
71 |
+
'columns' => $columns,
|
72 |
+
'title' => $title,
|
73 |
+
'orderby' => 'date',
|
74 |
+
'order' => 'desc',
|
75 |
)
|
76 |
);
|
|
|
77 |
echo $args['before_widget'];
|
78 |
+
echo '<section class="eaw-product-section woo-best-products">';
|
79 |
+
|
80 |
+
do_action( 'storepage_homepage_before_best_selling_products' );
|
81 |
+
echo '<h2 class="section-title">' . wp_kses_post( $args['title'] ) . '</h2>';
|
82 |
+
|
83 |
+
do_action( 'storepage_homepage_after_best_selling_products_title' );
|
84 |
+
echo eaw_do_shortcode(
|
85 |
+
'best_selling_products', array(
|
86 |
+
'per_page' => intval( $args['limit'] ),
|
87 |
+
'columns' => intval( $args['columns'] ),
|
88 |
+
)
|
89 |
+
);
|
90 |
+
do_action( 'storepage_homepage_after_best_selling_products' );
|
91 |
+
|
92 |
+
echo '</section>';
|
|
|
93 |
// echo '</div>';
|
94 |
echo $args['after_widget'];
|
95 |
|
102 |
}
|
103 |
|
104 |
public function update( $new_instance, $old_instance ) {
|
105 |
+
$instance = $old_instance;
|
106 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
107 |
+
$instance['limit'] = (int) $new_instance['limit'];
|
108 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
109 |
$this->flush_widget_cache();
|
110 |
|
127 |
* @param array $instance
|
128 |
*/
|
129 |
public function form( $instance ) {
|
130 |
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
131 |
+
$limit = isset( $instance['limit'] ) ? absint( $instance['limit'] ) : 4;
|
132 |
+
$columns = isset( $instance['columns '] ) ? absint( $instance['columns '] ) : 4;
|
133 |
+
?>
|
134 |
+
<p>
|
135 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
136 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>"
|
137 |
+
name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>"/>
|
138 |
+
</p>
|
139 |
+
|
140 |
+
<p>
|
141 |
+
<label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of products to show:', 'elementor-addon-widgets' ); ?></label>
|
142 |
+
<input id="<?php echo $this->get_field_id( 'limit' ); ?>"
|
143 |
+
name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo $limit; ?>"
|
144 |
+
size="3"/></p>
|
145 |
+
|
146 |
+
<p>
|
147 |
+
<label for="<?php echo $this->get_field_id( 'columns' ); ?>"><?php _e( 'Number of Columns:', 'elementor-addon-widgets' ); ?></label>
|
148 |
+
<input id="<?php echo $this->get_field_id( 'columns' ); ?>"
|
149 |
+
name="<?php echo $this->get_field_name( 'columns' ); ?>" type="text" value="<?php echo $columns; ?>"
|
150 |
+
size="3"/></p>
|
151 |
+
|
152 |
+
|
153 |
+
<?php
|
154 |
}
|
155 |
}
|
widgets/woo/featured-products.php
CHANGED
@@ -9,17 +9,17 @@ class Woo_Featured_Products extends WP_Widget {
|
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
-
'classname'
|
13 |
-
'description'
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
17 |
parent::__construct( 'woo-featured-products', __( 'Woo Featured Products', 'elementor-addon-widgets' ), $widget_ops );
|
18 |
$this->alt_option_name = 'woo_featured_products';
|
19 |
|
20 |
-
add_action( 'save_post', array($this, 'flush_widget_cache') );
|
21 |
-
add_action( 'deleted_post', array($this, 'flush_widget_cache') );
|
22 |
-
add_action( 'switch_theme', array($this, 'flush_widget_cache') );
|
23 |
}
|
24 |
|
25 |
/**
|
@@ -42,6 +42,7 @@ class Woo_Featured_Products extends WP_Widget {
|
|
42 |
|
43 |
if ( isset( $cache[ $args['widget_id'] ] ) ) {
|
44 |
echo $cache[ $args['widget_id'] ];
|
|
|
45 |
return;
|
46 |
}
|
47 |
|
@@ -66,34 +67,35 @@ class Woo_Featured_Products extends WP_Widget {
|
|
66 |
|
67 |
$args = apply_filters(
|
68 |
'elementor-addon-widgets_product_categories_args', array(
|
69 |
-
'limit'
|
70 |
-
'columns'
|
71 |
-
'title'
|
72 |
-
|
|
|
73 |
)
|
74 |
);
|
75 |
|
76 |
echo $args['before_widget'];
|
77 |
-
|
78 |
|
79 |
-
|
80 |
|
81 |
-
|
82 |
|
83 |
-
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
|
94 |
-
|
95 |
|
96 |
-
|
97 |
|
98 |
echo $args['after_widget'];
|
99 |
|
@@ -106,9 +108,9 @@ class Woo_Featured_Products extends WP_Widget {
|
|
106 |
}
|
107 |
|
108 |
public function update( $new_instance, $old_instance ) {
|
109 |
-
$instance
|
110 |
-
$instance['title']
|
111 |
-
$instance['limit']
|
112 |
$instance['columns'] = (int) $new_instance['columns'];
|
113 |
$this->flush_widget_cache();
|
114 |
|
@@ -131,20 +133,29 @@ class Woo_Featured_Products extends WP_Widget {
|
|
131 |
* @param array $instance
|
132 |
*/
|
133 |
public function form( $instance ) {
|
134 |
-
$title
|
135 |
-
$limit
|
136 |
-
$columns
|
137 |
-
|
138 |
-
<p
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
<p
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
}
|
150 |
}
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
+
'classname' => 'woo_featured_products',
|
13 |
+
'description' => __( 'Woo Featured Products - designed for use with the Elementor Page Builder plugin', 'elementor-addon-widgets' ),
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
17 |
parent::__construct( 'woo-featured-products', __( 'Woo Featured Products', 'elementor-addon-widgets' ), $widget_ops );
|
18 |
$this->alt_option_name = 'woo_featured_products';
|
19 |
|
20 |
+
add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
|
21 |
+
add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
|
22 |
+
add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
|
23 |
}
|
24 |
|
25 |
/**
|
42 |
|
43 |
if ( isset( $cache[ $args['widget_id'] ] ) ) {
|
44 |
echo $cache[ $args['widget_id'] ];
|
45 |
+
|
46 |
return;
|
47 |
}
|
48 |
|
67 |
|
68 |
$args = apply_filters(
|
69 |
'elementor-addon-widgets_product_categories_args', array(
|
70 |
+
'limit' => $limit,
|
71 |
+
'columns' => $columns,
|
72 |
+
'title' => $title,
|
73 |
+
'orderby' => 'date',
|
74 |
+
'order' => 'desc',
|
75 |
)
|
76 |
);
|
77 |
|
78 |
echo $args['before_widget'];
|
79 |
+
echo '<section class="eaw-product-section woo-featured-products">';
|
80 |
|
81 |
+
do_action( 'storepage_homepage_before_featured_products' );
|
82 |
|
83 |
+
echo '<h2 class="section-title">' . wp_kses_post( $args['title'] ) . '</h2>';
|
84 |
|
85 |
+
do_action( 'storepage_homepage_after_featured_products_title' );
|
86 |
|
87 |
+
echo eaw_do_shortcode(
|
88 |
+
'featured_products', array(
|
89 |
+
'per_page' => intval( $args['limit'] ),
|
90 |
+
'columns' => intval( $args['columns'] ),
|
91 |
+
'orderby' => esc_attr( $args['orderby'] ),
|
92 |
+
'order' => esc_attr( $args['order'] ),
|
93 |
+
)
|
94 |
+
);
|
95 |
|
96 |
+
do_action( 'storepage_homepage_after_featured_products' );
|
97 |
|
98 |
+
echo '</section>';
|
99 |
|
100 |
echo $args['after_widget'];
|
101 |
|
108 |
}
|
109 |
|
110 |
public function update( $new_instance, $old_instance ) {
|
111 |
+
$instance = $old_instance;
|
112 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
113 |
+
$instance['limit'] = (int) $new_instance['limit'];
|
114 |
$instance['columns'] = (int) $new_instance['columns'];
|
115 |
$this->flush_widget_cache();
|
116 |
|
133 |
* @param array $instance
|
134 |
*/
|
135 |
public function form( $instance ) {
|
136 |
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
137 |
+
$limit = isset( $instance['limit'] ) ? absint( $instance['limit'] ) : 4;
|
138 |
+
$columns = isset( $instance['columns '] ) ? absint( $instance['columns '] ) : 4;
|
139 |
+
?>
|
140 |
+
<p>
|
141 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
142 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>"
|
143 |
+
name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>"/>
|
144 |
+
</p>
|
145 |
+
|
146 |
+
<p>
|
147 |
+
<label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of products to show:', 'elementor-addon-widgets' ); ?></label>
|
148 |
+
<input id="<?php echo $this->get_field_id( 'limit' ); ?>"
|
149 |
+
name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo $limit; ?>"
|
150 |
+
size="3"/></p>
|
151 |
+
|
152 |
+
<p>
|
153 |
+
<label for="<?php echo $this->get_field_id( 'columns' ); ?>"><?php _e( 'Number of Columns:', 'elementor-addon-widgets' ); ?></label>
|
154 |
+
<input id="<?php echo $this->get_field_id( 'columns' ); ?>"
|
155 |
+
name="<?php echo $this->get_field_name( 'columns' ); ?>" type="text" value="<?php echo $columns; ?>"
|
156 |
+
size="3"/></p>
|
157 |
+
|
158 |
+
|
159 |
+
<?php
|
160 |
}
|
161 |
}
|
widgets/woo/popular-products.php
CHANGED
@@ -9,17 +9,17 @@ class Woo_Popular_Products extends WP_Widget {
|
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
-
'classname'
|
13 |
-
'description'
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
17 |
parent::__construct( 'woo-popular-products', __( 'Woo Popular Products', 'elementor-addon-widgets' ), $widget_ops );
|
18 |
$this->alt_option_name = 'woo_popular_products';
|
19 |
|
20 |
-
add_action( 'save_post', array($this, 'flush_widget_cache') );
|
21 |
-
add_action( 'deleted_post', array($this, 'flush_widget_cache') );
|
22 |
-
add_action( 'switch_theme', array($this, 'flush_widget_cache') );
|
23 |
}
|
24 |
|
25 |
/**
|
@@ -42,6 +42,7 @@ class Woo_Popular_Products extends WP_Widget {
|
|
42 |
|
43 |
if ( isset( $cache[ $args['widget_id'] ] ) ) {
|
44 |
echo $cache[ $args['widget_id'] ];
|
|
|
45 |
return;
|
46 |
}
|
47 |
|
@@ -66,33 +67,34 @@ class Woo_Popular_Products extends WP_Widget {
|
|
66 |
|
67 |
$args = apply_filters(
|
68 |
'elementor-addon-widgets_product_categories_args', array(
|
69 |
-
'limit'
|
70 |
-
'columns'
|
71 |
-
'title'
|
72 |
-
|
|
|
73 |
)
|
74 |
);
|
75 |
|
76 |
echo $args['before_widget'];
|
77 |
// echo '<div class="woo-popular-products">';
|
78 |
-
|
79 |
|
80 |
-
|
81 |
|
82 |
-
|
83 |
|
84 |
-
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
|
93 |
-
|
94 |
|
95 |
-
|
96 |
// echo '</div>';
|
97 |
echo $args['after_widget'];
|
98 |
|
@@ -105,9 +107,9 @@ class Woo_Popular_Products extends WP_Widget {
|
|
105 |
}
|
106 |
|
107 |
public function update( $new_instance, $old_instance ) {
|
108 |
-
$instance
|
109 |
-
$instance['title']
|
110 |
-
$instance['limit']
|
111 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
112 |
$this->flush_widget_cache();
|
113 |
|
@@ -130,20 +132,29 @@ class Woo_Popular_Products extends WP_Widget {
|
|
130 |
* @param array $instance
|
131 |
*/
|
132 |
public function form( $instance ) {
|
133 |
-
$title
|
134 |
-
$limit
|
135 |
-
$columns
|
136 |
-
|
137 |
-
<p
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
<p
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
}
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
+
'classname' => 'woo_popular_products',
|
13 |
+
'description' => __( 'Woo Popular Products - designed for use with the Elementor Page Builder plugin', 'elementor-addon-widgets' ),
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
17 |
parent::__construct( 'woo-popular-products', __( 'Woo Popular Products', 'elementor-addon-widgets' ), $widget_ops );
|
18 |
$this->alt_option_name = 'woo_popular_products';
|
19 |
|
20 |
+
add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
|
21 |
+
add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
|
22 |
+
add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
|
23 |
}
|
24 |
|
25 |
/**
|
42 |
|
43 |
if ( isset( $cache[ $args['widget_id'] ] ) ) {
|
44 |
echo $cache[ $args['widget_id'] ];
|
45 |
+
|
46 |
return;
|
47 |
}
|
48 |
|
67 |
|
68 |
$args = apply_filters(
|
69 |
'elementor-addon-widgets_product_categories_args', array(
|
70 |
+
'limit' => $limit,
|
71 |
+
'columns' => $columns,
|
72 |
+
'title' => $title,
|
73 |
+
'orderby' => 'date',
|
74 |
+
'order' => 'desc',
|
75 |
)
|
76 |
);
|
77 |
|
78 |
echo $args['before_widget'];
|
79 |
// echo '<div class="woo-popular-products">';
|
80 |
+
echo '<section class="eaw-product-section woo-popular-products">';
|
81 |
|
82 |
+
do_action( 'storepage_homepage_before_popular_products' );
|
83 |
|
84 |
+
echo '<h2 class="section-title">' . wp_kses_post( $args['title'] ) . '</h2>';
|
85 |
|
86 |
+
do_action( 'storepage_homepage_after_popular_products_title' );
|
87 |
|
88 |
+
echo eaw_do_shortcode(
|
89 |
+
'top_rated_products', array(
|
90 |
+
'per_page' => intval( $args['limit'] ),
|
91 |
+
'columns' => intval( $args['columns'] ),
|
92 |
+
)
|
93 |
+
);
|
94 |
|
95 |
+
do_action( 'storepage_homepage_after_popular_products' );
|
96 |
|
97 |
+
echo '</section>';
|
98 |
// echo '</div>';
|
99 |
echo $args['after_widget'];
|
100 |
|
107 |
}
|
108 |
|
109 |
public function update( $new_instance, $old_instance ) {
|
110 |
+
$instance = $old_instance;
|
111 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
112 |
+
$instance['limit'] = (int) $new_instance['limit'];
|
113 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
114 |
$this->flush_widget_cache();
|
115 |
|
132 |
* @param array $instance
|
133 |
*/
|
134 |
public function form( $instance ) {
|
135 |
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
136 |
+
$limit = isset( $instance['limit'] ) ? absint( $instance['limit'] ) : 4;
|
137 |
+
$columns = isset( $instance['columns '] ) ? absint( $instance['columns '] ) : 4;
|
138 |
+
?>
|
139 |
+
<p>
|
140 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
141 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>"
|
142 |
+
name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>"/>
|
143 |
+
</p>
|
144 |
+
|
145 |
+
<p>
|
146 |
+
<label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of products to show:', 'elementor-addon-widgets' ); ?></label>
|
147 |
+
<input id="<?php echo $this->get_field_id( 'limit' ); ?>"
|
148 |
+
name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo $limit; ?>"
|
149 |
+
size="3"/></p>
|
150 |
+
|
151 |
+
<p>
|
152 |
+
<label for="<?php echo $this->get_field_id( 'columns' ); ?>"><?php _e( 'Number of Columns:', 'elementor-addon-widgets' ); ?></label>
|
153 |
+
<input id="<?php echo $this->get_field_id( 'columns' ); ?>"
|
154 |
+
name="<?php echo $this->get_field_name( 'columns' ); ?>" type="text" value="<?php echo $columns; ?>"
|
155 |
+
size="3"/></p>
|
156 |
+
|
157 |
+
|
158 |
+
<?php
|
159 |
}
|
160 |
}
|
widgets/woo/products-categories.php
CHANGED
@@ -9,8 +9,8 @@ class Woo_Product_Categories extends WP_Widget {
|
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
-
'classname'
|
13 |
-
'description'
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
@@ -66,11 +66,11 @@ class Woo_Product_Categories extends WP_Widget {
|
|
66 |
|
67 |
$args = apply_filters(
|
68 |
'eaw_product_categories_args', array(
|
69 |
-
'limit'
|
70 |
-
'columns'
|
71 |
-
'child_categories'
|
72 |
-
'orderby'
|
73 |
-
'title'
|
74 |
)
|
75 |
);
|
76 |
|
@@ -108,9 +108,9 @@ class Woo_Product_Categories extends WP_Widget {
|
|
108 |
}
|
109 |
|
110 |
public function update( $new_instance, $old_instance ) {
|
111 |
-
$instance
|
112 |
-
$instance['title']
|
113 |
-
$instance['limit']
|
114 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
115 |
$this->flush_widget_cache();
|
116 |
|
@@ -133,9 +133,9 @@ class Woo_Product_Categories extends WP_Widget {
|
|
133 |
* @param array $instance
|
134 |
*/
|
135 |
public function form( $instance ) {
|
136 |
-
$title
|
137 |
-
$limit
|
138 |
-
$columns
|
139 |
?>
|
140 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
141 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
+
'classname' => 'woo_product_categories',
|
13 |
+
'description' => __( 'Woo Product Categories - designed for use with the Elementor Page Builder plugin', 'elementor-addon-widgets' ),
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
66 |
|
67 |
$args = apply_filters(
|
68 |
'eaw_product_categories_args', array(
|
69 |
+
'limit' => $limit,
|
70 |
+
'columns' => $columns,
|
71 |
+
'child_categories' => 0,
|
72 |
+
'orderby' => 'name',
|
73 |
+
'title' => $title,
|
74 |
)
|
75 |
);
|
76 |
|
108 |
}
|
109 |
|
110 |
public function update( $new_instance, $old_instance ) {
|
111 |
+
$instance = $old_instance;
|
112 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
113 |
+
$instance['limit'] = (int) $new_instance['limit'];
|
114 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
115 |
$this->flush_widget_cache();
|
116 |
|
133 |
* @param array $instance
|
134 |
*/
|
135 |
public function form( $instance ) {
|
136 |
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
137 |
+
$limit = isset( $instance['limit'] ) ? absint( $instance['limit'] ) : 3;
|
138 |
+
$columns = isset( $instance['columns '] ) ? absint( $instance['columns '] ) : 3;
|
139 |
?>
|
140 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
141 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
widgets/woo/recent-products.php
CHANGED
@@ -9,8 +9,8 @@ class Woo_Recent_Products extends WP_Widget {
|
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
-
'classname'
|
13 |
-
'description'
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
@@ -66,9 +66,9 @@ class Woo_Recent_Products extends WP_Widget {
|
|
66 |
|
67 |
$args = apply_filters(
|
68 |
'elementor-addon-widgets_product_categories_args', array(
|
69 |
-
'limit'
|
70 |
-
'columns'
|
71 |
-
'title'
|
72 |
)
|
73 |
);
|
74 |
|
@@ -104,9 +104,9 @@ class Woo_Recent_Products extends WP_Widget {
|
|
104 |
}
|
105 |
|
106 |
public function update( $new_instance, $old_instance ) {
|
107 |
-
$instance
|
108 |
-
$instance['title']
|
109 |
-
$instance['limit']
|
110 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
111 |
$this->flush_widget_cache();
|
112 |
|
@@ -129,9 +129,9 @@ class Woo_Recent_Products extends WP_Widget {
|
|
129 |
* @param array $instance
|
130 |
*/
|
131 |
public function form( $instance ) {
|
132 |
-
$title
|
133 |
-
$limit
|
134 |
-
$columns
|
135 |
?>
|
136 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
137 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
+
'classname' => 'woo_recent_products',
|
13 |
+
'description' => __( 'Woo Recent Products - designed for use with the Elementor Page Builder plugin', 'elementor-addon-widgets' ),
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
66 |
|
67 |
$args = apply_filters(
|
68 |
'elementor-addon-widgets_product_categories_args', array(
|
69 |
+
'limit' => $limit,
|
70 |
+
'columns' => $columns,
|
71 |
+
'title' => $title,
|
72 |
)
|
73 |
);
|
74 |
|
104 |
}
|
105 |
|
106 |
public function update( $new_instance, $old_instance ) {
|
107 |
+
$instance = $old_instance;
|
108 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
109 |
+
$instance['limit'] = (int) $new_instance['limit'];
|
110 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
111 |
$this->flush_widget_cache();
|
112 |
|
129 |
* @param array $instance
|
130 |
*/
|
131 |
public function form( $instance ) {
|
132 |
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
133 |
+
$limit = isset( $instance['limit'] ) ? absint( $instance['limit'] ) : 4;
|
134 |
+
$columns = isset( $instance['columns '] ) ? absint( $instance['columns '] ) : 4;
|
135 |
?>
|
136 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
137 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
widgets/woo/sale-products.php
CHANGED
@@ -9,8 +9,8 @@ class Woo_Sale_Products extends WP_Widget {
|
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
-
'classname'
|
13 |
-
'description'
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
@@ -66,9 +66,9 @@ class Woo_Sale_Products extends WP_Widget {
|
|
66 |
|
67 |
$args = apply_filters(
|
68 |
'elementor-addon-widgets_product_categories_args', array(
|
69 |
-
'limit'
|
70 |
-
'columns'
|
71 |
-
'title'
|
72 |
)
|
73 |
);
|
74 |
|
@@ -104,9 +104,9 @@ class Woo_Sale_Products extends WP_Widget {
|
|
104 |
}
|
105 |
|
106 |
public function update( $new_instance, $old_instance ) {
|
107 |
-
$instance
|
108 |
-
$instance['title']
|
109 |
-
$instance['limit']
|
110 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
111 |
$this->flush_widget_cache();
|
112 |
|
@@ -129,9 +129,9 @@ class Woo_Sale_Products extends WP_Widget {
|
|
129 |
* @param array $instance
|
130 |
*/
|
131 |
public function form( $instance ) {
|
132 |
-
$title
|
133 |
-
$limit
|
134 |
-
$columns
|
135 |
?>
|
136 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
137 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
+
'classname' => 'woo_sale_products',
|
13 |
+
'description' => __( 'Woo On Sale Products - designed for use with the Elementor Page Builder plugin', 'elementor-addon-widgets' ),
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
66 |
|
67 |
$args = apply_filters(
|
68 |
'elementor-addon-widgets_product_categories_args', array(
|
69 |
+
'limit' => $limit,
|
70 |
+
'columns' => $columns,
|
71 |
+
'title' => $title,
|
72 |
)
|
73 |
);
|
74 |
|
104 |
}
|
105 |
|
106 |
public function update( $new_instance, $old_instance ) {
|
107 |
+
$instance = $old_instance;
|
108 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
109 |
+
$instance['limit'] = (int) $new_instance['limit'];
|
110 |
$instance['columns'] = (int) ( $new_instance['columns'] );
|
111 |
$this->flush_widget_cache();
|
112 |
|
129 |
* @param array $instance
|
130 |
*/
|
131 |
public function form( $instance ) {
|
132 |
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
133 |
+
$limit = isset( $instance['limit'] ) ? absint( $instance['limit'] ) : 4;
|
134 |
+
$columns = isset( $instance['columns '] ) ? absint( $instance['columns '] ) : 4;
|
135 |
?>
|
136 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
137 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
widgets/wp/eaw-posts-widget-plus.php
CHANGED
@@ -9,8 +9,8 @@ class EAW_Recent_Posts_Plus extends WP_Widget {
|
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
-
'classname'
|
13 |
-
'description'
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
@@ -55,7 +55,7 @@ class EAW_Recent_Posts_Plus extends WP_Widget {
|
|
55 |
$number = 3;
|
56 |
}
|
57 |
|
58 |
-
$category
|
59 |
|
60 |
$show_excerpt = isset( $instance['show_excerpt'] ) ? $instance['show_excerpt'] : false;
|
61 |
$excerptcount = ( ! empty( $instance['excerptcount'] ) ) ? absint( $instance['excerptcount'] ) : 20;
|
@@ -119,10 +119,10 @@ class EAW_Recent_Posts_Plus extends WP_Widget {
|
|
119 |
}
|
120 |
|
121 |
public function update( $new_instance, $old_instance ) {
|
122 |
-
$instance
|
123 |
-
$instance['title']
|
124 |
-
$instance['number']
|
125 |
-
$instance['category']
|
126 |
$instance['excerptcount'] = (int) ( $new_instance['excerptcount'] );
|
127 |
$instance['show_excerpt'] = isset( $new_instance['show_excerpt'] ) ? (bool) $new_instance['show_excerpt'] : false;
|
128 |
$this->flush_widget_cache();
|
@@ -146,11 +146,11 @@ class EAW_Recent_Posts_Plus extends WP_Widget {
|
|
146 |
* @param array $instance
|
147 |
*/
|
148 |
public function form( $instance ) {
|
149 |
-
$title
|
150 |
-
$number
|
151 |
-
$excerptcount
|
152 |
-
$show_excerpt
|
153 |
-
$category
|
154 |
?>
|
155 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
156 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
+
'classname' => 'widget_recent_posts_plus',
|
13 |
+
'description' => __( 'Recent posts with featured image - ideal for use with Elementor Page Builder plugin', 'elementor-addon-widgets' ),
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
55 |
$number = 3;
|
56 |
}
|
57 |
|
58 |
+
$category = isset( $instance['category'] ) ? $instance['category'] : '';
|
59 |
|
60 |
$show_excerpt = isset( $instance['show_excerpt'] ) ? $instance['show_excerpt'] : false;
|
61 |
$excerptcount = ( ! empty( $instance['excerptcount'] ) ) ? absint( $instance['excerptcount'] ) : 20;
|
119 |
}
|
120 |
|
121 |
public function update( $new_instance, $old_instance ) {
|
122 |
+
$instance = $old_instance;
|
123 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
124 |
+
$instance['number'] = (int) $new_instance['number'];
|
125 |
+
$instance['category'] = wp_strip_all_tags( $new_instance['category'] );
|
126 |
$instance['excerptcount'] = (int) ( $new_instance['excerptcount'] );
|
127 |
$instance['show_excerpt'] = isset( $new_instance['show_excerpt'] ) ? (bool) $new_instance['show_excerpt'] : false;
|
128 |
$this->flush_widget_cache();
|
146 |
* @param array $instance
|
147 |
*/
|
148 |
public function form( $instance ) {
|
149 |
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
150 |
+
$number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 3;
|
151 |
+
$excerptcount = isset( $instance['excerptcount '] ) ? absint( $instance['excerptcount '] ) : 20;
|
152 |
+
$show_excerpt = isset( $instance['show_excerpt'] ) ? (bool) $instance['show_excerpt'] : false;
|
153 |
+
$category = isset( $instance['category'] ) ? $instance['category'] : '';
|
154 |
?>
|
155 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
156 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
widgets/wp/eaw-posts-widget.php
CHANGED
@@ -9,8 +9,8 @@ class EAW_Recent_Posts extends WP_Widget {
|
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
-
'classname'
|
13 |
-
'description'
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
@@ -115,9 +115,9 @@ class EAW_Recent_Posts extends WP_Widget {
|
|
115 |
}
|
116 |
|
117 |
public function update( $new_instance, $old_instance ) {
|
118 |
-
$instance
|
119 |
-
$instance['title']
|
120 |
-
$instance['number']
|
121 |
$instance['excerptcount'] = (int) ( $new_instance['excerptcount'] );
|
122 |
$instance['show_excerpt'] = isset( $new_instance['show_excerpt'] ) ? (bool) $new_instance['show_excerpt'] : false;
|
123 |
$this->flush_widget_cache();
|
@@ -141,10 +141,10 @@ class EAW_Recent_Posts extends WP_Widget {
|
|
141 |
* @param array $instance
|
142 |
*/
|
143 |
public function form( $instance ) {
|
144 |
-
$title
|
145 |
-
$number
|
146 |
-
$excerptcount
|
147 |
-
$show_excerpt
|
148 |
?>
|
149 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
150 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
9 |
|
10 |
public function __construct() {
|
11 |
$widget_ops = array(
|
12 |
+
'classname' => 'widget_recent_posts',
|
13 |
+
'description' => __( 'Recent posts with featured image - ideal for use with Elementor Page Builder plugin', 'elementor-addon-widgets' ),
|
14 |
'customize_selective_refresh' => true,
|
15 |
);
|
16 |
|
115 |
}
|
116 |
|
117 |
public function update( $new_instance, $old_instance ) {
|
118 |
+
$instance = $old_instance;
|
119 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
120 |
+
$instance['number'] = (int) $new_instance['number'];
|
121 |
$instance['excerptcount'] = (int) ( $new_instance['excerptcount'] );
|
122 |
$instance['show_excerpt'] = isset( $new_instance['show_excerpt'] ) ? (bool) $new_instance['show_excerpt'] : false;
|
123 |
$this->flush_widget_cache();
|
141 |
* @param array $instance
|
142 |
*/
|
143 |
public function form( $instance ) {
|
144 |
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
145 |
+
$number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 3;
|
146 |
+
$excerptcount = isset( $instance['excerptcount '] ) ? absint( $instance['excerptcount '] ) : 20;
|
147 |
+
$show_excerpt = isset( $instance['show_excerpt'] ) ? (bool) $instance['show_excerpt'] : false;
|
148 |
?>
|
149 |
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'elementor-addon-widgets' ); ?></label>
|
150 |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
|