Orbit Fox by ThemeIsle - Version 1.0.2

Version Description

Download this release

Release Info

Developer themeisle
Plugin Icon 128x128 Orbit Fox by ThemeIsle
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

assets/js/widget-media.js CHANGED
@@ -1,95 +1,95 @@
1
- /* global jQuery */
2
- /* global wp */
3
- jQuery(document).ready( function($) {
4
- 'use strict';
5
-
6
- $(document).on('change','.custom_media_url',function() {
7
- var value = $.trim($(this).val());
8
- var image_input = $(this).parent().find('.custom_media_image');
9
- var media_id = $(this).parent().parent().find('.custom_media_id');
10
- if(value.length === 0){
11
- image_input.attr('src','');
12
- image_input.attr('alt','');
13
- media_id.val('');
14
- }
15
- var saveBtn = $(this).closest('.form').find('.widget-control-save');
16
- if (typeof saveBtn !== 'undefined') {
17
- saveBtn.trigger( "click" );
18
- }
19
- });
20
-
21
- function media_upload(button_class) {
22
- var _custom_media = true;
23
-
24
- $('body').on('click', button_class, function() {
25
-
26
- var button_id ='#'+$(this).attr('id');
27
- var media_id = jQuery(this).parent().parent().children('.custom_media_id');
28
- var display_field = jQuery(this).parent().children('input:text');
29
- var display_image = jQuery(this).parent().children('.custom_media_image');
30
- var image_in_customizer = jQuery(this).parent().children('.custom_media_display_in_customizer');
31
-
32
- _custom_media = true;
33
-
34
- wp.media.editor.send.attachment = function(props, attachment) {
35
- if( typeof attachment !== 'undefined' ) {
36
- if ( _custom_media ) {
37
- if ( typeof display_field !== 'undefined' ) {
38
-
39
- if( typeof attachment.id !== 'undefined' ) {
40
- media_id.val(attachment.id);
41
- }
42
-
43
- if ( typeof attachment.sizes !== 'undefined' ) {
44
- if ( typeof attachment.sizes.thumbnail !== 'undefined' ) {
45
- if (typeof(attachment.sizes.thumbnail.url) !== 'undefined') {
46
- display_image.attr('src', attachment.sizes.thumbnail.url).css('display', 'block');
47
- image_in_customizer.val(attachment.sizes.thumbnail.url);
48
- }
49
- }
50
- else {
51
- if( typeof attachment.url !== 'undefined' ) {
52
- display_image.attr('src', attachment.url).css('display', 'block');
53
- image_in_customizer.val(attachment.url);
54
- }
55
- }
56
- }
57
- else {
58
- if ( typeof attachment.url !== 'undefined' ) {
59
- display_image.attr('src', attachment.url).css('display', 'block');
60
- image_in_customizer.val(attachment.url);
61
- }
62
- }
63
-
64
- switch (props.size) {
65
- case 'full':
66
- display_field.val(attachment.sizes.full.url);
67
- break;
68
- case 'medium':
69
- display_field.val(attachment.sizes.medium.url);
70
- break;
71
- case 'thumbnail':
72
- display_field.val(attachment.sizes.thumbnail.url);
73
- break;
74
- default:
75
- display_field.val(attachment.url);
76
- break;
77
- }
78
- display_field.trigger('change');
79
- }
80
- } else {
81
- return wp.media.editor.send.attachment(button_id, [props, attachment]);
82
- }
83
- }
84
- };
85
-
86
- wp.media.editor.open(button_class);
87
- window.send_to_editor = function (html) {
88
-
89
- };
90
- return false;
91
- });
92
- }
93
-
94
- media_upload('.custom_media_button');
95
  });
1
+ /* global jQuery */
2
+ /* global wp */
3
+ jQuery(document).ready( function($) {
4
+ 'use strict';
5
+
6
+ $(document).on('change','.custom_media_url',function() {
7
+ var value = $.trim($(this).val());
8
+ var image_input = $(this).parent().find('.custom_media_image');
9
+ var media_id = $(this).parent().parent().find('.custom_media_id');
10
+ if(value.length === 0){
11
+ image_input.attr('src','');
12
+ image_input.attr('alt','');
13
+ media_id.val('');
14
+ }
15
+ var saveBtn = $(this).closest('.form').find('.widget-control-save');
16
+ if (typeof saveBtn !== 'undefined') {
17
+ saveBtn.trigger( "click" );
18
+ }
19
+ });
20
+
21
+ function media_upload(button_class) {
22
+ var _custom_media = true;
23
+
24
+ $('body').on('click', button_class, function() {
25
+
26
+ var button_id ='#'+$(this).attr('id');
27
+ var media_id = jQuery(this).parent().parent().children('.custom_media_id');
28
+ var display_field = jQuery(this).parent().children('input:text');
29
+ var display_image = jQuery(this).parent().children('.custom_media_image');
30
+ var image_in_customizer = jQuery(this).parent().children('.custom_media_display_in_customizer');
31
+
32
+ _custom_media = true;
33
+
34
+ wp.media.editor.send.attachment = function(props, attachment) {
35
+ if( typeof attachment !== 'undefined' ) {
36
+ if ( _custom_media ) {
37
+ if ( typeof display_field !== 'undefined' ) {
38
+
39
+ if( typeof attachment.id !== 'undefined' ) {
40
+ media_id.val(attachment.id);
41
+ }
42
+
43
+ if ( typeof attachment.sizes !== 'undefined' ) {
44
+ if ( typeof attachment.sizes.thumbnail !== 'undefined' ) {
45
+ if (typeof(attachment.sizes.thumbnail.url) !== 'undefined') {
46
+ display_image.attr('src', attachment.sizes.thumbnail.url).css('display', 'block');
47
+ image_in_customizer.val(attachment.sizes.thumbnail.url);
48
+ }
49
+ }
50
+ else {
51
+ if( typeof attachment.url !== 'undefined' ) {
52
+ display_image.attr('src', attachment.url).css('display', 'block');
53
+ image_in_customizer.val(attachment.url);
54
+ }
55
+ }
56
+ }
57
+ else {
58
+ if ( typeof attachment.url !== 'undefined' ) {
59
+ display_image.attr('src', attachment.url).css('display', 'block');
60
+ image_in_customizer.val(attachment.url);
61
+ }
62
+ }
63
+
64
+ switch (props.size) {
65
+ case 'full':
66
+ display_field.val(attachment.sizes.full.url);
67
+ break;
68
+ case 'medium':
69
+ display_field.val(attachment.sizes.medium.url);
70
+ break;
71
+ case 'thumbnail':
72
+ display_field.val(attachment.sizes.thumbnail.url);
73
+ break;
74
+ default:
75
+ display_field.val(attachment.url);
76
+ break;
77
+ }
78
+ display_field.trigger('change');
79
+ }
80
+ } else {
81
+ return wp.media.editor.send.attachment(button_id, [props, attachment]);
82
+ }
83
+ }
84
+ };
85
+
86
+ wp.media.editor.open(button_class);
87
+ window.send_to_editor = function (html) {
88
+
89
+ };
90
+ return false;
91
+ });
92
+ }
93
+
94
+ media_upload('.custom_media_button');
95
  });
inc/hestia/hestia-functions.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Companion code for Hestia
4
+ *
5
+ * @author Themeisle
6
+ * @package themeisle-companion
7
+ */
8
+
9
+ /**
10
+ * Include sections from Companion plugin
11
+ */
12
+ function themeisle_hestia_require() {
13
+
14
+ if ( function_exists( 'hestia_setup_theme' ) ) {
15
+
16
+ // Require Zerif > Hestia content importer if it exists.
17
+ $zerif_importer_path = trailingslashit( THEMEISLE_COMPANION_PATH ) . 'inc/hestia/inc/features/import-zerif-content.php';
18
+ if ( file_exists( $zerif_importer_path ) ) {
19
+ require_once( $zerif_importer_path );
20
+ }
21
+
22
+ // Require Hestia Features section and customizer settings.
23
+ $features_path = trailingslashit( THEMEISLE_COMPANION_PATH ) . 'inc/hestia/inc/features/feature-features-section.php';
24
+ $customizer_features_path = trailingslashit( THEMEISLE_COMPANION_PATH ) . 'inc/hestia/inc/sections/hestia-features-section.php';
25
+ if ( file_exists( $features_path ) ) {
26
+ require_once( $features_path );
27
+ }
28
+ if ( file_exists( $customizer_features_path ) ) {
29
+ require_once( $customizer_features_path );
30
+ }
31
+
32
+ // Require Hestia Testimonials section and customizer settings.
33
+ $testimonials_path = trailingslashit( THEMEISLE_COMPANION_PATH ) . 'inc/hestia/inc/features/feature-testimonials-section.php';
34
+ $customizer_testimonials_path = trailingslashit( THEMEISLE_COMPANION_PATH ) . 'inc/hestia/inc/sections/hestia-testimonials-section.php';
35
+ if ( file_exists( $testimonials_path ) ) {
36
+ require_once( $testimonials_path );
37
+ }
38
+ if ( file_exists( $customizer_testimonials_path ) ) {
39
+ require_once( $customizer_testimonials_path );
40
+ }
41
+
42
+ // Require Hestia Team section and customizer settings.
43
+ $team_path = trailingslashit( THEMEISLE_COMPANION_PATH ) . 'inc/hestia/inc/features/feature-team-section.php';
44
+ $customizer_team_path = trailingslashit( THEMEISLE_COMPANION_PATH ) . 'inc/hestia/inc/sections/hestia-team-section.php';
45
+ if ( file_exists( $team_path ) ) {
46
+ require_once( $team_path );
47
+ }
48
+ if ( file_exists( $customizer_team_path ) ) {
49
+ require_once( $customizer_team_path );
50
+ }
51
+
52
+ // Require Hestia Customizer extension.
53
+ $customizer_path = trailingslashit( THEMEISLE_COMPANION_PATH ) . 'inc/hestia/inc/customizer.php';
54
+ if ( file_exists( $customizer_path ) ) {
55
+ require_once( $customizer_path );
56
+ }
57
+ }
58
+ }
59
+
60
+ add_action( 'after_setup_theme', 'themeisle_hestia_require' );
inc/hestia/inc/customizer.php ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer Extension for Hestia Companion
4
+ *
5
+ * @package Hestia Companion
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! function_exists( 'hestia_companion_customize_register' ) ) :
10
+ /**
11
+ * Hestia Companion Customize Register
12
+ */
13
+ function hestia_companion_customize_register( $wp_customize ) {
14
+
15
+ // Change defaults for customizer controls for features section.
16
+ $hestia_features_title_control = $wp_customize->get_setting( 'hestia_features_title' );
17
+ if ( ! empty( $hestia_features_title_control ) ) {
18
+ $hestia_features_title_control->default = esc_html__( 'Why our product is the best', 'themeisle-companion' );
19
+ }
20
+
21
+ $hestia_features_subtitle_control = $wp_customize->get_setting( 'hestia_features_subtitle' );
22
+ if ( ! empty( $hestia_features_subtitle_control ) ) {
23
+ $hestia_features_subtitle_control->default = esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' );
24
+ }
25
+
26
+ $hestia_features_content_control = $wp_customize->get_setting( 'hestia_features_content' );
27
+ if ( ! empty( $hestia_features_content_control ) ) {
28
+ $hestia_features_content_control->default = json_encode( array(
29
+ array(
30
+ 'icon_value' => 'fa-wechat',
31
+ 'title' => esc_html__( 'Responsive', 'themeisle-companion' ),
32
+ 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ),
33
+ 'link' => '#',
34
+ 'id' => 'customizer_repeater_56d7ea7f40b56',
35
+ 'color' => '#e91e63',
36
+ ),
37
+ array(
38
+ 'icon_value' => 'fa-check',
39
+ 'title' => esc_html__( 'Quality', 'themeisle-companion' ),
40
+ 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ),
41
+ 'link' => '#',
42
+ 'id' => 'customizer_repeater_56d7ea7f40b66',
43
+ 'color' => '#00bcd4',
44
+ ),
45
+ array(
46
+ 'icon_value' => 'fa-support',
47
+ 'title' => esc_html__( 'Support', 'themeisle-companion' ),
48
+ 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ),
49
+ 'link' => '#',
50
+ 'id' => 'customizer_repeater_56d7ea7f40b86',
51
+ 'color' => '#4caf50',
52
+ ),
53
+ ) );
54
+
55
+ }
56
+
57
+ // Change defaults for customizer controls for team section.
58
+ $hestia_team_title_control = $wp_customize->get_setting( 'hestia_team_title' );
59
+ if ( ! empty( $hestia_team_title_control ) ) {
60
+ $hestia_team_title_control->default = esc_html__( 'Meet our team', 'themeisle-companion' );
61
+ }
62
+ $hestia_team_subtitle_control = $wp_customize->get_setting( 'hestia_team_subtitle' );
63
+ if ( ! empty( $hestia_team_subtitle_control ) ) {
64
+ $hestia_team_subtitle_control->default = esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' );
65
+ }
66
+ $hestia_team_content_control = $wp_customize->get_setting( 'hestia_team_content' );
67
+ if ( ! empty( $hestia_team_content_control ) ) {
68
+ $hestia_team_content_control->default = json_encode( array(
69
+ array(
70
+ 'image_url' => get_template_directory_uri() . '/assets/img/1.jpg',
71
+ 'title' => esc_html__( 'Desmond Purpleson', 'themeisle-companion' ),
72
+ 'subtitle' => esc_html__( 'CEO', 'themeisle-companion' ),
73
+ 'text' => esc_html__( 'Locavore pinterest chambray affogato art party, forage coloring book typewriter. Bitters cold selfies, retro celiac sartorial mustache.', 'themeisle-companion' ),
74
+ 'id' => 'customizer_repeater_56d7ea7f40c56',
75
+ 'social_repeater' => json_encode( array(
76
+ array(
77
+ 'id' => 'customizer-repeater-social-repeater-57fb908674e06',
78
+ 'link' => 'facebook.com',
79
+ 'icon' => 'fa-facebook',
80
+ ),
81
+ array(
82
+ 'id' => 'customizer-repeater-social-repeater-57fb9148530ft',
83
+ 'link' => 'plus.google.com',
84
+ 'icon' => 'fa-google-plus',
85
+ ),
86
+ array(
87
+ 'id' => 'customizer-repeater-social-repeater-57fb9148530fc',
88
+ 'link' => 'twitter.com',
89
+ 'icon' => 'fa-twitter',
90
+ ),
91
+ array(
92
+ 'id' => 'customizer-repeater-social-repeater-57fb9150e1e89',
93
+ 'link' => 'linkedin.com',
94
+ 'icon' => 'fa-linkedin',
95
+ ),
96
+ ) ),
97
+ ),
98
+ array(
99
+ 'image_url' => get_template_directory_uri() . '/assets/img/2.jpg',
100
+ 'title' => esc_html__( 'Parsley Pepperspray', 'themeisle-companion' ),
101
+ 'subtitle' => esc_html__( 'Marketing Specialist', 'themeisle-companion' ),
102
+ 'text' => esc_html__( 'Craft beer salvia celiac mlkshk. Pinterest celiac tumblr, portland salvia skateboard cliche thundercats. Tattooed chia austin hell.', 'themeisle-companion' ),
103
+ 'id' => 'customizer_repeater_56d7ea7f40c66',
104
+ 'social_repeater' => json_encode( array(
105
+ array(
106
+ 'id' => 'customizer-repeater-social-repeater-57fb9155a1072',
107
+ 'link' => 'facebook.com',
108
+ 'icon' => 'fa-facebook',
109
+ ),
110
+ array(
111
+ 'id' => 'customizer-repeater-social-repeater-57fb9160ab683',
112
+ 'link' => 'twitter.com',
113
+ 'icon' => 'fa-twitter',
114
+ ),
115
+ array(
116
+ 'id' => 'customizer-repeater-social-repeater-57fb9160ab484',
117
+ 'link' => 'pinterest.com',
118
+ 'icon' => 'fa-pinterest',
119
+ ),
120
+ array(
121
+ 'id' => 'customizer-repeater-social-repeater-57fb916ddffc9',
122
+ 'link' => 'linkedin.com',
123
+ 'icon' => 'fa-linkedin',
124
+ ),
125
+ ) ),
126
+ ),
127
+ array(
128
+ 'image_url' => get_template_directory_uri() . '/assets/img/3.jpg',
129
+ 'title' => esc_html__( 'Desmond Eagle', 'themeisle-companion' ),
130
+ 'subtitle' => esc_html__( 'Graphic Designer', 'themeisle-companion' ),
131
+ 'text' => esc_html__( 'Pok pok direct trade godard street art, poutine fam typewriter food truck narwhal kombucha wolf cardigan butcher whatever pickled you.', 'themeisle-companion' ),
132
+ 'id' => 'customizer_repeater_56d7ea7f40c76',
133
+ 'social_repeater' => json_encode( array(
134
+ array(
135
+ 'id' => 'customizer-repeater-social-repeater-57fb917e4c69e',
136
+ 'link' => 'facebook.com',
137
+ 'icon' => 'fa-facebook',
138
+ ),
139
+ array(
140
+ 'id' => 'customizer-repeater-social-repeater-57fb91830825c',
141
+ 'link' => 'twitter.com',
142
+ 'icon' => 'fa-twitter',
143
+ ),
144
+ array(
145
+ 'id' => 'customizer-repeater-social-repeater-57fb918d65f2e',
146
+ 'link' => 'linkedin.com',
147
+ 'icon' => 'fa-linkedin',
148
+ ),
149
+ array(
150
+ 'id' => 'customizer-repeater-social-repeater-57fb918d65f2x',
151
+ 'link' => 'dribbble.com',
152
+ 'icon' => 'fa-dribbble',
153
+ ),
154
+ ) ),
155
+ ),
156
+ array(
157
+ 'image_url' => get_template_directory_uri() . '/assets/img/4.jpg',
158
+ 'title' => esc_html__( 'Ruby Von Rails', 'themeisle-companion' ),
159
+ 'subtitle' => esc_html__( 'Lead Developer', 'themeisle-companion' ),
160
+ 'text' => esc_html__( 'Small batch vexillologist 90\'s blue bottle stumptown bespoke. Pok pok tilde fixie chartreuse, VHS gluten-free selfies wolf hot.', 'themeisle-companion' ),
161
+ 'id' => 'customizer_repeater_56d7ea7f40c86',
162
+ 'social_repeater' => json_encode( array(
163
+ array(
164
+ 'id' => 'customizer-repeater-social-repeater-57fb925cedcg5',
165
+ 'link' => 'github.com',
166
+ 'icon' => 'fa-github-square',
167
+ ),
168
+ array(
169
+ 'id' => 'customizer-repeater-social-repeater-57fb925cedcb2',
170
+ 'link' => 'facebook.com',
171
+ 'icon' => 'fa-facebook',
172
+ ),
173
+ array(
174
+ 'id' => 'customizer-repeater-social-repeater-57fb92615f030',
175
+ 'link' => 'twitter.com',
176
+ 'icon' => 'fa-twitter',
177
+ ),
178
+ array(
179
+ 'id' => 'customizer-repeater-social-repeater-57fb9266c223a',
180
+ 'link' => 'linkedin.com',
181
+ 'icon' => 'fa-linkedin',
182
+ ),
183
+ ) ),
184
+ ),
185
+ ) );
186
+ }// End if().
187
+
188
+ $hestia_testimonials_title_setting = $wp_customize->get_setting( 'hestia_testimonials_title' );
189
+ if ( ! empty( $hestia_testimonials_title_setting ) ) {
190
+ $hestia_testimonials_title_setting->default = esc_html__( 'What clients say', 'themeisle-companion' );
191
+ }
192
+ $hestia_testimonials_subtitle_setting = $wp_customize->get_setting( 'hestia_testimonials_subtitle' );
193
+ if ( ! empty( $hestia_testimonials_subtitle_setting ) ) {
194
+ $hestia_testimonials_subtitle_setting->default = esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' );
195
+ }
196
+ $hestia_testimonials_content_setting = $wp_customize->get_setting( 'hestia_testimonials_content' );
197
+ if ( ! empty( $hestia_testimonials_content_setting ) ) {
198
+ $hestia_testimonials_content_setting->default = json_encode( array(
199
+ array(
200
+ 'image_url' => get_template_directory_uri() . '/assets/img/5.jpg',
201
+ 'title' => esc_html__( 'Inverness McKenzie', 'themeisle-companion' ),
202
+ 'subtitle' => esc_html__( 'Business Owner', 'themeisle-companion' ),
203
+ 'text' => esc_html__( '"We have no regrets! After using your product my business skyrocketed! I made back the purchase price in just 48 hours! I couldn\'t have asked for more than this."', 'themeisle-companion' ),
204
+ 'id' => 'customizer_repeater_56d7ea7f40d56',
205
+ ),
206
+ array(
207
+ 'image_url' => get_template_directory_uri() . '/assets/img/6.jpg',
208
+ 'title' => esc_html__( 'Hanson Deck', 'themeisle-companion' ),
209
+ 'subtitle' => esc_html__( 'Independent Artist', 'themeisle-companion' ),
210
+ 'text' => esc_html__( '"Your company is truly upstanding and is behind its product 100 percent. Hestia is worth much more than I paid. I like Hestia more each day because it makes easier."', 'themeisle-companion' ),
211
+ 'id' => 'customizer_repeater_56d7ea7f40d66',
212
+ ),
213
+ array(
214
+ 'image_url' => get_template_directory_uri() . '/assets/img/7.jpg',
215
+ 'title' => esc_html__( 'Natalya Undergrowth', 'themeisle-companion' ),
216
+ 'subtitle' => esc_html__( 'Freelancer', 'themeisle-companion' ),
217
+ 'text' => esc_html__( '"Thank you for making it painless, pleasant and most of all hassle free! I am so pleased with this product. Dude, your stuff is great! I will refer everyone I know."', 'themeisle-companion' ),
218
+ 'id' => 'customizer_repeater_56d7ea7f40d76',
219
+ ),
220
+ ) );
221
+ }
222
+
223
+ }
224
+
225
+ add_action( 'customize_register', 'hestia_companion_customize_register' );
226
+ endif;
inc/hestia/inc/features/feature-features-section.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer functionality for the Features section.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Hestia
7
+ * @since Hestia 1.0
8
+ */
9
+
10
+ // Load Customizer repeater control.
11
+ $repeater_path = trailingslashit( get_template_directory() ) . '/inc/customizer-repeater/functions.php';
12
+ if ( file_exists( $repeater_path ) ) {
13
+ require_once( $repeater_path );
14
+ }
15
+
16
+ if ( ! function_exists( 'hestia_features_customize_register' ) ) :
17
+ /**
18
+ * Hook controls for Features section to Customizer.
19
+ *
20
+ * @since Hestia 1.0
21
+ */
22
+ function hestia_features_customize_register( $wp_customize ) {
23
+
24
+ $wp_customize->add_section( 'hestia_features', array(
25
+ 'title' => esc_html__( 'Features', 'hestia-companion', 'themeisle-companion' ),
26
+ 'panel' => 'hestia_frontpage_sections',
27
+ 'priority' => apply_filters( 'hestia_section_priority', 10, 'hestia_features' ),
28
+ ) );
29
+
30
+ $wp_customize->add_setting( 'hestia_features_hide', array(
31
+ 'sanitize_callback' => 'hestia_sanitize_checkbox',
32
+ 'default' => false,
33
+ ) );
34
+
35
+ $wp_customize->add_control( 'hestia_features_hide', array(
36
+ 'type' => 'checkbox',
37
+ 'label' => esc_html__( 'Disable section', 'hestia-companion', 'themeisle-companion' ),
38
+ 'section' => 'hestia_features',
39
+ 'priority' => 1,
40
+ ) );
41
+
42
+ $wp_customize->add_setting( 'hestia_features_title', array(
43
+ 'sanitize_callback' => 'sanitize_text_field',
44
+ 'transport' => 'postMessage',
45
+ ) );
46
+
47
+ $wp_customize->add_control( 'hestia_features_title', array(
48
+ 'label' => esc_html__( 'Section Title', 'hestia-companion', 'themeisle-companion' ),
49
+ 'section' => 'hestia_features',
50
+ 'priority' => 5,
51
+ ) );
52
+
53
+ $wp_customize->add_setting( 'hestia_features_subtitle', array(
54
+ 'sanitize_callback' => 'sanitize_text_field',
55
+ 'transport' => 'postMessage',
56
+ ) );
57
+
58
+ $wp_customize->add_control( 'hestia_features_subtitle', array(
59
+ 'label' => esc_html__( 'Section Subtitle', 'hestia-companion', 'themeisle-companion' ),
60
+ 'section' => 'hestia_features',
61
+ 'priority' => 10,
62
+ ) );
63
+
64
+ if ( class_exists( 'Hestia_Repeater' ) ) {
65
+ $wp_customize->add_setting( 'hestia_features_content', array(
66
+ 'sanitize_callback' => 'hestia_repeater_sanitize',
67
+ ) );
68
+
69
+ $wp_customize->add_control( new Hestia_Repeater( $wp_customize, 'hestia_features_content', array(
70
+ 'label' => esc_html__( 'Features Content', 'hestia-companion', 'themeisle-companion' ),
71
+ 'section' => 'hestia_features',
72
+ 'priority' => 15,
73
+ 'add_field_label' => esc_html__( 'Add new Feature', 'hestia-companion', 'themeisle-companion' ),
74
+ 'item_name' => esc_html__( 'Feature', 'hestia-companion', 'themeisle-companion' ),
75
+ 'customizer_repeater_icon_control' => true,
76
+ 'customizer_repeater_title_control' => true,
77
+ 'customizer_repeater_text_control' => true,
78
+ 'customizer_repeater_link_control' => true,
79
+ 'customizer_repeater_color_control' => true,
80
+ ) ) );
81
+ }
82
+
83
+ }
84
+
85
+ add_action( 'customize_register', 'hestia_features_customize_register' );
86
+
87
+ endif;
inc/hestia/inc/features/feature-team-section.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer functionality for the Team section.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Hestia
7
+ * @since Hestia 1.0
8
+ */
9
+
10
+ // Load Customizer repeater control.
11
+ $repeater_path = trailingslashit( get_template_directory() ) . '/inc/customizer-repeater/functions.php';
12
+ if ( file_exists( $repeater_path ) ) {
13
+ require_once( $repeater_path );
14
+ }
15
+
16
+ if ( ! function_exists( 'hestia_team_customize_register' ) ) :
17
+ /**
18
+ * Hook controls for Team section to Customizer.
19
+ *
20
+ * @since Hestia 1.0
21
+ */
22
+ function hestia_team_customize_register( $wp_customize ) {
23
+
24
+ $wp_customize->add_section( 'hestia_team', array(
25
+ 'title' => esc_html__( 'Team', 'hestia-companion', 'themeisle-companion' ),
26
+ 'panel' => 'hestia_frontpage_sections',
27
+ 'priority' => apply_filters( 'hestia_section_priority', 30, 'hestia_team' ),
28
+ ) );
29
+
30
+ $wp_customize->add_setting( 'hestia_team_hide', array(
31
+ 'sanitize_callback' => 'hestia_sanitize_checkbox',
32
+ 'default' => false,
33
+ ) );
34
+
35
+ $wp_customize->add_control( 'hestia_team_hide', array(
36
+ 'type' => 'checkbox',
37
+ 'label' => esc_html__( 'Disable section', 'hestia-companion', 'themeisle-companion' ),
38
+ 'section' => 'hestia_team',
39
+ 'priority' => 1,
40
+ ) );
41
+
42
+ $wp_customize->add_setting( 'hestia_team_title', array(
43
+ 'sanitize_callback' => 'sanitize_text_field',
44
+ 'transport' => 'postMessage',
45
+ ) );
46
+
47
+ $wp_customize->add_control( 'hestia_team_title', array(
48
+ 'label' => esc_html__( 'Section Title', 'hestia-companion', 'themeisle-companion' ),
49
+ 'section' => 'hestia_team',
50
+ 'priority' => 5,
51
+ ) );
52
+
53
+ $wp_customize->add_setting( 'hestia_team_subtitle', array(
54
+ 'sanitize_callback' => 'sanitize_text_field',
55
+ 'transport' => 'postMessage',
56
+ ) );
57
+
58
+ $wp_customize->add_control( 'hestia_team_subtitle', array(
59
+ 'label' => esc_html__( 'Section Subtitle', 'hestia-companion', 'themeisle-companion' ),
60
+ 'section' => 'hestia_team',
61
+ 'priority' => 10,
62
+ ) );
63
+
64
+ if ( class_exists( 'Hestia_Repeater' ) ) {
65
+ $wp_customize->add_setting( 'hestia_team_content', array(
66
+ 'sanitize_callback' => 'hestia_repeater_sanitize',
67
+ ) );
68
+
69
+ $wp_customize->add_control( new Hestia_Repeater( $wp_customize, 'hestia_team_content', array(
70
+ 'label' => esc_html__( 'Team Content', 'hestia-companion', 'themeisle-companion' ),
71
+ 'section' => 'hestia_team',
72
+ 'priority' => 15,
73
+ 'add_field_label' => esc_html__( 'Add new Team Member', 'hestia-companion', 'themeisle-companion' ),
74
+ 'item_name' => esc_html__( 'Team Member', 'hestia-companion', 'themeisle-companion' ),
75
+ 'customizer_repeater_image_control' => true,
76
+ 'customizer_repeater_title_control' => true,
77
+ 'customizer_repeater_subtitle_control' => true,
78
+ 'customizer_repeater_text_control' => true,
79
+ 'customizer_repeater_link_control' => true,
80
+ 'customizer_repeater_repeater_control' => true,
81
+ ) ) );
82
+ }
83
+ }
84
+
85
+ add_action( 'customize_register', 'hestia_team_customize_register' );
86
+
87
+ endif;
inc/hestia/inc/features/feature-testimonials-section.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer functionality for the Testimonials section.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Hestia
7
+ * @since Hestia 1.0
8
+ */
9
+
10
+ // Load Customizer repeater control.
11
+ $repeater_path = trailingslashit( get_template_directory() ) . '/inc/customizer-repeater/functions.php';
12
+ if ( file_exists( $repeater_path ) ) {
13
+ require_once( $repeater_path );
14
+ }
15
+
16
+ if ( ! function_exists( 'hestia_testimonials_customize_register' ) ) :
17
+ /**
18
+ * Hook controls for Testimonials section to Customizer.
19
+ *
20
+ * @since Hestia 1.0
21
+ */
22
+ function hestia_testimonials_customize_register( $wp_customize ) {
23
+
24
+ $wp_customize->add_section( 'hestia_testimonials', array(
25
+ 'title' => esc_html__( 'Testimonials', 'hestia-companion', 'themeisle-companion' ),
26
+ 'panel' => 'hestia_frontpage_sections',
27
+ 'priority' => apply_filters( 'hestia_section_priority', 40, 'hestia_testimonials' ),
28
+ ) );
29
+
30
+ $wp_customize->add_setting( 'hestia_testimonials_hide', array(
31
+ 'sanitize_callback' => 'hestia_sanitize_checkbox',
32
+ 'default' => false,
33
+ ) );
34
+
35
+ $wp_customize->add_control( 'hestia_testimonials_hide', array(
36
+ 'type' => 'checkbox',
37
+ 'label' => esc_html__( 'Disable section', 'hestia-companion', 'themeisle-companion' ),
38
+ 'section' => 'hestia_testimonials',
39
+ 'priority' => 1,
40
+ ) );
41
+
42
+ $wp_customize->add_setting( 'hestia_testimonials_title', array(
43
+ 'sanitize_callback' => 'sanitize_text_field',
44
+ 'transport' => 'postMessage',
45
+ ) );
46
+
47
+ $wp_customize->add_control( 'hestia_testimonials_title', array(
48
+ 'label' => esc_html__( 'Section Title', 'hestia-companion', 'themeisle-companion' ),
49
+ 'section' => 'hestia_testimonials',
50
+ 'priority' => 5,
51
+ ) );
52
+
53
+ $wp_customize->add_setting( 'hestia_testimonials_subtitle', array(
54
+ 'sanitize_callback' => 'sanitize_text_field',
55
+ 'transport' => 'postMessage',
56
+ ) );
57
+
58
+ $wp_customize->add_control( 'hestia_testimonials_subtitle', array(
59
+ 'label' => esc_html__( 'Section Subtitle', 'hestia-companion', 'themeisle-companion' ),
60
+ 'section' => 'hestia_testimonials',
61
+ 'priority' => 10,
62
+ ) );
63
+
64
+ if ( class_exists( 'Hestia_Repeater' ) ) {
65
+ $wp_customize->add_setting( 'hestia_testimonials_content', array(
66
+ 'sanitize_callback' => 'hestia_repeater_sanitize',
67
+ ) );
68
+
69
+ $wp_customize->add_control( new Hestia_Repeater( $wp_customize, 'hestia_testimonials_content', array(
70
+ 'label' => esc_html__( 'Testimonials Content', 'hestia-companion', 'themeisle-companion' ),
71
+ 'section' => 'hestia_testimonials',
72
+ 'priority' => 15,
73
+ 'add_field_label' => esc_html__( 'Add new Testimonial', 'hestia-companion', 'themeisle-companion' ),
74
+ 'item_name' => esc_html__( 'Testimonial', 'hestia-companion', 'themeisle-companion' ),
75
+ 'customizer_repeater_image_control' => true,
76
+ 'customizer_repeater_title_control' => true,
77
+ 'customizer_repeater_subtitle_control' => true,
78
+ 'customizer_repeater_text_control' => true,
79
+ 'customizer_repeater_link_control' => true,
80
+ ) ) );
81
+ }
82
+ }
83
+
84
+ add_action( 'customize_register', 'hestia_testimonials_customize_register' );
85
+
86
+ endif;
inc/hestia/inc/features/import-zerif-content.php ADDED
@@ -0,0 +1,677 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Import content from Zerif theme when theme is activated.
4
+ *
5
+ * @package Hestia
6
+ * @since 1.1.16
7
+ */
8
+
9
+ if ( ! function_exists( 'hestia_import_zerif_content' ) ) {
10
+ /**
11
+ * Main import function
12
+ */
13
+ function hestia_import_zerif_content() {
14
+
15
+ $zerif_pro_content = get_option( 'theme_mods_zerif-pro' );
16
+ $zerif_lite_content = get_option( 'theme_mods_zerif-lite' );
17
+
18
+ if ( ! empty( $zerif_pro_content ) ) {
19
+ hestia_import_old_theme_content( $zerif_pro_content );
20
+ } elseif ( ! empty( $zerif_lite_content ) ) {
21
+ hestia_import_old_theme_content( $zerif_lite_content );
22
+ }
23
+ }
24
+ }
25
+ add_action( 'after_switch_theme', 'hestia_import_zerif_content', 0 );
26
+
27
+ /**
28
+ * Import old content from Zerif
29
+ *
30
+ * @param array $content the content from previous zerif instance.
31
+ */
32
+ function hestia_import_old_theme_content( $content ) {
33
+ hestia_import_simple_theme_mods( $content );
34
+ hestia_import_widgets_as_theme_mods( $content );
35
+ }
36
+
37
+ /**
38
+ * Set fixed theme mods from Zerif.
39
+ *
40
+ * @param array $content the content from previous zerif instance.
41
+ */
42
+ function hestia_import_simple_theme_mods( $content ) {
43
+ $slider_content_theme_mod = get_theme_mod( 'hestia_slider_content' );
44
+ if ( empty( $slider_content_theme_mod ) ) {
45
+ /* Import the big title section / slider */
46
+ if ( ! empty( $content['zerif_bigtitle_title_2'] ) ) {
47
+ $big_title_text = $content['zerif_bigtitle_title_2'];
48
+ } elseif ( ! empty( $content['zerif_bigtitle_title'] ) ) {
49
+ $big_title_text = $content['zerif_bigtitle_title'];
50
+ }
51
+ if ( ! empty( $content['zerif_bigtitle_redbutton_label_2'] ) ) {
52
+ $big_title_button_text = $content['zerif_bigtitle_redbutton_label_2'];
53
+ } elseif ( ! empty( $content['zerif_bigtitle_redbutton_label'] ) ) {
54
+ $big_title_button_text = $content['zerif_bigtitle_redbutton_label'];
55
+ } elseif ( ! empty( $content['zerif_bigtitle_greenbutton_label'] ) ) {
56
+ $big_title_button_text = $content['zerif_bigtitle_greenbutton_label'];
57
+ }
58
+ if ( ! empty( $content['zerif_bigtitle_redbutton_url'] ) ) {
59
+ $big_title_button_link = $content['zerif_bigtitle_redbutton_url'];
60
+ } elseif ( ! empty( $content['zerif_bigtitle_greenbutton_url'] ) ) {
61
+ $big_title_button_link = $content['zerif_bigtitle_greenbutton_url'];
62
+ }
63
+ if ( ! empty( $content['zerif_background_settings'] ) ) {
64
+ $big_title_background_settings = $content['zerif_background_settings'];
65
+ }
66
+
67
+ if ( ! empty( $big_title_text ) || ( ! empty( $big_title_button_text ) && ! empty( $big_title_button_link ) ) || ! empty( $big_title_background_settings ) ) {
68
+
69
+ $imported_slider_content = array();
70
+
71
+ /* Check the background type from Zerif ( image or slider ) */
72
+ if ( ! empty( $big_title_background_settings ) ) {
73
+ if ( $big_title_background_settings == 'zerif-background-slider' ) {
74
+ $slider_background = array();
75
+ for ( $i = 1; $i <= 3; $i ++ ) {
76
+ if ( ! empty( $content[ 'zerif_bgslider_' . $i ] ) ) {
77
+ array_push( $slider_background, $content[ 'zerif_bgslider_' . $i ] );
78
+ }
79
+ }
80
+ }
81
+ } elseif ( ! empty( $content['background_image'] ) ) {
82
+ $slider_background = $content['background_image'];
83
+ } else {
84
+ $slider_background = get_template_directory_uri() . '/assets/img/slider3.jpg';
85
+ }
86
+
87
+ if ( ! empty( $slider_background ) ) {
88
+ if ( is_array( $slider_background ) ) {
89
+ /* Set a slider for the multiple slides background. */
90
+ foreach ( $slider_background as $background ) {
91
+ $transient_imported_slider_content = array(
92
+ 'image_url' => esc_url( $background ),
93
+ 'title' => ! empty( $big_title_text ) ? wp_kses_post( $big_title_text ) : '',
94
+ 'text' => ! empty( $big_title_button_text ) ? esc_html( $big_title_button_text ) : '',
95
+ 'link' => ! empty( $big_title_button_link ) ? esc_url( $big_title_button_link ) : '',
96
+ );
97
+ array_push( $imported_slider_content, $transient_imported_slider_content );
98
+ }
99
+ } else {
100
+ /* Set a single slide for the single image background. */
101
+ $imported_slider_content = array(
102
+ array(
103
+ 'image_url' => esc_url( $slider_background ),
104
+ 'title' => ! empty( $big_title_text ) ? wp_kses_post( $big_title_text ) : '',
105
+ 'text' => ! empty( $big_title_button_text ) ? esc_html( $big_title_button_text ) : '',
106
+ 'link' => ! empty( $big_title_button_link ) ? esc_url( $big_title_button_link ) : '',
107
+ ),
108
+ );
109
+ }
110
+ }
111
+ }// End if().
112
+
113
+ /* Set the slider based on the imported content. */
114
+ if ( ! empty( $imported_slider_content ) ) {
115
+ set_theme_mod( 'hestia_slider_content', json_encode( $imported_slider_content ) );
116
+ }
117
+ }// End if().
118
+ /* END OF SLIDER IMPORT */
119
+
120
+ /* Import the "Big Title" section */
121
+ if( ! empty( $content['background_image'] ) ) {
122
+ set_theme_mod( 'hestia_big_title_background', $content['background_image'] );
123
+ }
124
+ if( ! empty( $big_title_text ) ) {
125
+ set_theme_mod( 'hestia_big_title_title', $big_title_text );
126
+ }
127
+ if( ! empty( $big_title_button_text ) ) {
128
+ set_theme_mod( 'hestia_big_title_button_text', $big_title_button_text );
129
+ }
130
+ if( ! empty( $big_title_button_link ) ) {
131
+ set_theme_mod( 'hestia_big_title_button_link', $big_title_button_link );
132
+ }
133
+ set_theme_mod( 'hestia_big_title_text', '' );
134
+ /* END OF BIG TITLE IMPORT */
135
+
136
+ /* Import the texts from "Our Focus" */
137
+ hestia_import_customizer_setting( $content, 'zerif_ourfocus_title', 'hestia_features_title' );
138
+ hestia_import_customizer_setting( $content, 'zerif_ourfocus_subtitle', 'hestia_features_subtitle' );
139
+ /* END OF OUR FOCUS TITLES IMPORT */
140
+
141
+ /* Import the texts from "Our Team" */
142
+ hestia_import_customizer_setting( $content, 'zerif_ourteam_title', 'hestia_team_title' );
143
+ hestia_import_customizer_setting( $content, 'zerif_ourteam_subtitle', 'hestia_team_subtitle' );
144
+ /* END OF TEAM TITLES IMPORT */
145
+
146
+ /* Import the texts from "Testimonials" */
147
+ hestia_import_customizer_setting( $content, 'zerif_testimonials_title', 'hestia_testimonials_title' );
148
+ hestia_import_customizer_setting( $content, 'zerif_testimonials_subtitle', 'hestia_testimonials_subtitle' );
149
+ /* END OF TESTIMONIALS TITLES IMPORT */
150
+
151
+ /* Import the texts from "Contact" */
152
+ hestia_import_customizer_setting( $content, 'zerif_contactus_title', 'hestia_contact_title' );
153
+ hestia_import_customizer_setting( $content, 'zerif_contactus_subtitle', 'hestia_contact_subtitle' );
154
+ /* END OF CONTACT TITLES IMPORT */
155
+
156
+ /* Import the texts from "Packages" */
157
+ hestia_import_customizer_setting( $content, 'zerif_packages_title', 'hestia_pricing_title' );
158
+ hestia_import_customizer_setting( $content, 'zerif_packages_subtitle', 'hestia_pricing_subtitle' );
159
+ /* END OF PACKAGES TITLES IMPORT */
160
+
161
+ /* Import the texts from "Subscribe" */
162
+ hestia_import_customizer_setting( $content, 'zerif_subscribe_title', 'hestia_subscribe_title' );
163
+ hestia_import_customizer_setting( $content, 'zerif_subscribe_subtitle', 'hestia_subscribe_subtitle' );
164
+ /* END OF SUBSCRIBE TITLES IMPORT */
165
+
166
+ /* Import the custom logo */
167
+ hestia_import_customizer_setting( $content, 'custom_logo', 'custom_logo' );
168
+ /* END OF CUSTOM LOGO IMPORT */
169
+
170
+ $contact_theme_mod = get_theme_mod( 'hestia_contact_content_new' );
171
+ if ( empty( $contact_theme_mod ) ) {
172
+ if ( ! empty( $content['zerif_email'] ) ) {
173
+ $email = $content['zerif_email'];
174
+ }
175
+ if ( ! empty( $content['zerif_phone'] ) ) {
176
+ $phone = $content['zerif_phone'];
177
+ }
178
+ if ( ! empty( $content['zerif_address'] ) ) {
179
+ $address = $content['zerif_address'];
180
+ }
181
+
182
+ $contact_content = '';
183
+
184
+ if ( ! empty( $email ) ) {
185
+ $contact_content .= '<div class="info info-horizontal"><div class="icon icon-primary"><i class="fa fa-envelope"></i></div><div class="description"><h4 class="info-title">' . wp_kses_post( $email ) . '</h4></div>';
186
+ }
187
+
188
+ if ( ! empty( $phone ) ) {
189
+ $contact_content .= '<div class="info info-horizontal"><div class="icon icon-primary"><i class="fa fa-phone"></i></div><div class="description"><h4 class="info-title">' . wp_kses_post( $phone ) . '</h4></div>';
190
+ }
191
+
192
+ if ( ! empty( $address ) ) {
193
+ $contact_content .= '<div class="info info-horizontal"><div class="icon icon-primary"><i class="fa fa-map-marker"></i></div><div class="description"><h4 class="info-title">' . wp_kses_post( $address ) . '</h4></div>';
194
+ }
195
+
196
+ if ( ! empty( $contact_content ) ) {
197
+ set_theme_mod( 'hestia_contact_content_new', $contact_content );
198
+ }
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Import widgets as theme mods.
204
+ *
205
+ * @param array $content the content from previous zerif instance.
206
+ */
207
+ function hestia_import_widgets_as_theme_mods( $content ) {
208
+
209
+ /* Define the sidebars to be checked for widgets. */
210
+ $sidebars = array(
211
+ 'sidebar-ourfocus',
212
+ 'sidebar-testimonials',
213
+ 'sidebar-aboutus',
214
+ 'sidebar-ourteam',
215
+ 'sidebar-packages',
216
+ 'sidebar-subscribe',
217
+ );
218
+
219
+ // Declare arrays to store the widgets id's.
220
+ $focus_widgets_ids = array();
221
+ $team_widgets_ids = array();
222
+ $testimonial_widgets_ids = array();
223
+ $package_widgets_ids = array();
224
+ $clients_widgets_ids = array();
225
+
226
+ $sidebars_widgets = wp_get_sidebars_widgets();
227
+
228
+ foreach ( $sidebars as $sidebar_id ) {
229
+
230
+ // A nested array in the format $sidebar_id => array( 'widget_id-1', 'widget_id-2' ... );
231
+ // Get the widget ID's per sidebar
232
+ if ( ! empty( $sidebars_widgets[ $sidebar_id ] ) ) {
233
+ $widgets_long_ids = $sidebars_widgets[ $sidebar_id ];
234
+
235
+ if ( is_array( $widgets_long_ids ) && ! empty( $widgets_long_ids ) ) {
236
+ foreach ( $widgets_long_ids as $id ) {
237
+
238
+ $short_id_transient = explode( '-', $id );
239
+ $short_id = end( $short_id_transient );
240
+
241
+ if ( strpos( $id, 'ctup-ads' ) !== false ) {
242
+ array_push( $focus_widgets_ids, $short_id );
243
+ } elseif ( strpos( $id, 'zerif_testim' ) !== false ) {
244
+ array_push( $testimonial_widgets_ids, $short_id );
245
+ } elseif ( strpos( $id, 'zerif_team' ) !== false ) {
246
+ array_push( $team_widgets_ids, $short_id );
247
+ } elseif ( strpos( $id, 'color-picker' ) !== false ) {
248
+ array_push( $package_widgets_ids, $short_id );
249
+ } elseif ( strpos( $id, 'zerif_clients' ) !== false ) {
250
+ array_push( $clients_widgets_ids, $short_id );
251
+ }
252
+ }
253
+ }
254
+ }
255
+ }
256
+
257
+ hestia_import_focus_widgets( $focus_widgets_ids );
258
+ hestia_import_testimonial_widgets( $testimonial_widgets_ids );
259
+ hestia_import_team_widgets( $team_widgets_ids );
260
+ hestia_import_packages_widgets( $package_widgets_ids );
261
+ hestia_import_about_us_content( $content, $clients_widgets_ids );
262
+ }
263
+
264
+ /**
265
+ * Import Focus Widgets to Features Section.
266
+ *
267
+ * @param array $widget_ids the ids of focus widgets active inside sidebars.
268
+ */
269
+ function hestia_import_focus_widgets( $widget_ids ) {
270
+ $features_content = get_theme_mod( 'hestia_features_content' );
271
+ if ( empty( $features_content ) ) {
272
+ if ( ! empty( $widget_ids ) ) {
273
+ $widgets_content = array();
274
+ $widgets_exported_content = array();
275
+ $widgets = get_option( 'widget_ctup-ads-widget' );
276
+ foreach ( $widget_ids as $widget_id ) {
277
+ array_push( $widgets_content, $widgets[ $widget_id ] );
278
+ }
279
+ foreach ( $widgets_content as $widget_content ) {
280
+ $transient_content = array();
281
+
282
+ if ( isset( $widget_content['title'] ) ) {
283
+ $transient_content['title'] = $widget_content['title'];
284
+ }
285
+ if ( isset( $widget_content['text'] ) ) {
286
+ $transient_content['text'] = $widget_content['text'];
287
+ }
288
+ if ( isset( $widget_content['link'] ) ) {
289
+ $transient_content['link'] = $widget_content['link'];
290
+ }
291
+ $transient_content['icon_value'] = 'fa-circle-thin';
292
+ $transient_content['color'] = '#9c27b0';
293
+ array_push( $widgets_exported_content, $transient_content );
294
+ }
295
+ $widgets_exported_content = json_encode( $widgets_exported_content );
296
+ set_theme_mod( 'hestia_features_content', $widgets_exported_content );
297
+ }
298
+ }
299
+ }
300
+
301
+ /**
302
+ * Import Testimonial Widgets to Testimonial Section.
303
+ *
304
+ * @param array $widget_ids the ids of testimonial widgets active inside sidebars.
305
+ */
306
+ function hestia_import_testimonial_widgets( $widget_ids ) {
307
+ $testimonials_content = get_theme_mod( 'hestia_testimonials_content' );
308
+ if ( empty( $testimonials_content ) ) {
309
+ if ( ! empty( $widget_ids ) ) {
310
+ $widgets_content = array();
311
+ $widgets_exported_content = array();
312
+ $widgets = get_option( 'widget_zerif_testim-widget' );
313
+ foreach ( $widget_ids as $widget_id ) {
314
+ array_push( $widgets_content, $widgets[ $widget_id ] );
315
+ }
316
+ foreach ( $widgets_content as $widget_content ) {
317
+ $transient_content = array();
318
+
319
+ if ( isset( $widget_content['text'] ) ) {
320
+ $transient_content['text'] = $widget_content['text'];
321
+ }
322
+ if ( isset( $widget_content['title'] ) ) {
323
+ $transient_content['title'] = $widget_content['title'];
324
+ }
325
+ if ( isset( $widget_content['details'] ) ) {
326
+ $transient_content['subtitle'] = $widget_content['details'];
327
+ }
328
+ if ( isset( $widget_content['image_uri'] ) ) {
329
+ $transient_content['image_url'] = $widget_content['image_uri'];
330
+ }
331
+ array_push( $widgets_exported_content, $transient_content );
332
+ }
333
+ $widgets_exported_content = json_encode( $widgets_exported_content );
334
+ set_theme_mod( 'hestia_testimonials_content', $widgets_exported_content );
335
+ }
336
+ }
337
+ }
338
+
339
+ /**
340
+ * Import Team Widgets to Team Section.
341
+ *
342
+ * @param array $widget_ids the ids of team member widgets active inside sidebars.
343
+ */
344
+ function hestia_import_team_widgets( $widget_ids ) {
345
+ $team_content = get_theme_mod( 'hestia_team_content' );
346
+ if ( empty( $team_content ) ) {
347
+ if ( ! empty( $widget_ids ) ) {
348
+ $widgets_content = array();
349
+ $widgets_exported_content = array();
350
+ $widgets = get_option( 'widget_zerif_team-widget' );
351
+ foreach ( $widget_ids as $widget_id ) {
352
+ array_push( $widgets_content, $widgets[ $widget_id ] );
353
+ }
354
+ foreach ( $widgets_content as $widget_content ) {
355
+ $transient_content = array();
356
+ $transient_socials = array();
357
+
358
+ if ( isset( $widget_content['image_uri'] ) ) {
359
+ $transient_content['image_url'] = $widget_content['image_uri'];
360
+ }
361
+ if ( isset( $widget_content['name'] ) ) {
362
+ $transient_content['title'] = $widget_content['name'];
363
+ }
364
+ if ( isset( $widget_content['position'] ) ) {
365
+ $transient_content['subtitle'] = $widget_content['position'];
366
+ }
367
+ if ( isset( $widget_content['description'] ) ) {
368
+ $transient_content['text'] = $widget_content['description'];
369
+ }
370
+
371
+ if ( ! empty( $widget_content['fb_link'] ) ) {
372
+ $social_item = array(
373
+ 'link' => $widget_content['fb_link'],
374
+ 'icon' => 'fa-facebook',
375
+ );
376
+ array_push( $social_item, $transient_socials );
377
+ }
378
+
379
+ if ( ! empty( $widget_content['tw_link'] ) ) {
380
+ $social_item = array(
381
+ 'link' => $widget_content['tw_link'],
382
+ 'icon' => 'fa-twitter',
383
+ );
384
+ array_push( $social_item, $transient_socials );
385
+ }
386
+
387
+ if ( ! empty( $widget_content['bh_link'] ) ) {
388
+ $social_item = array(
389
+ 'link' => $widget_content['bh_link'],
390
+ 'icon' => 'fa-behance',
391
+ );
392
+ array_push( $social_item, $transient_socials );
393
+ }
394
+
395
+ if ( ! empty( $widget_content['db_link'] ) ) {
396
+ $social_item = array(
397
+ 'link' => $widget_content['db_link'],
398
+ 'icon' => 'fa-dribbble',
399
+ );
400
+ array_push( $social_item, $transient_socials );
401
+ }
402
+
403
+ if ( ! empty( $widget_content['ln_link'] ) ) {
404
+ $social_item = array(
405
+ 'link' => $widget_content['ln_link'],
406
+ 'icon' => 'fa-linkedin',
407
+ );
408
+ array_push( $social_item, $transient_socials );
409
+ }
410
+
411
+ if ( ! empty( $widget_content['gp_link'] ) ) {
412
+ $social_item = array(
413
+ 'link' => $widget_content['gp_link'],
414
+ 'icon' => 'fa-google-plus',
415
+ );
416
+ array_push( $social_item, $transient_socials );
417
+ }
418
+
419
+ if ( ! empty( $widget_content['pinterest_link'] ) ) {
420
+ $social_item = array(
421
+ 'link' => $widget_content['pinterest_link'],
422
+ 'icon' => 'fa-pinterest',
423
+ );
424
+ array_push( $social_item, $transient_socials );
425
+ }
426
+
427
+ if ( ! empty( $widget_content['tumblr_link'] ) ) {
428
+ $social_item = array(
429
+ 'link' => $widget_content['tumblr_link'],
430
+ 'icon' => 'fa-tumblr',
431
+ );
432
+ array_push( $social_item, $transient_socials );
433
+ }
434
+
435
+ if ( ! empty( $widget_content['reddit_link'] ) ) {
436
+ $social_item = array(
437
+ 'link' => $widget_content['reddit_link'],
438
+ 'icon' => 'fa-reddit',
439
+ );
440
+ array_push( $social_item, $transient_socials );
441
+ }
442
+
443
+ if ( ! empty( $widget_content['youtube_link'] ) ) {
444
+ $social_item = array(
445
+ 'link' => $widget_content['youtube_link'],
446
+ 'icon' => 'fa-youtube',
447
+ );
448
+ array_push( $social_item, $transient_socials );
449
+ }
450
+
451
+ if ( ! empty( $widget_content['instagram_link'] ) ) {
452
+ $social_item = array(
453
+ 'link' => $widget_content['instagram_link'],
454
+ 'icon' => 'fa-instagram',
455
+ );
456
+ array_push( $social_item, $transient_socials );
457
+ }
458
+
459
+ if ( ! empty( $widget_content['website_link'] ) ) {
460
+ $social_item = array(
461
+ 'link' => $widget_content['website_link'],
462
+ 'icon' => 'fa-globe',
463
+ );
464
+ array_push( $social_item, $transient_socials );
465
+ }
466
+
467
+ if ( ! empty( $widget_content['email_link'] ) ) {
468
+ $social_item = array(
469
+ 'link' => $widget_content['email_link'],
470
+ 'icon' => 'fa-envelope',
471
+ );
472
+ array_push( $social_item, $transient_socials );
473
+ }
474
+
475
+ if ( ! empty( $widget_content['phone_link'] ) ) {
476
+ $social_item = array(
477
+ 'link' => $widget_content['phone_link'],
478
+ 'icon' => 'fa-phone',
479
+ );
480
+ array_push( $social_item, $transient_socials );
481
+ }
482
+
483
+ $transient_content['social_repeater'] = json_encode( $transient_socials );
484
+ array_push( $widgets_exported_content, $transient_content );
485
+ }// End foreach().
486
+ $widgets_exported_content = json_encode( $widgets_exported_content );
487
+ set_theme_mod( 'hestia_team_content', $widgets_exported_content );
488
+ }// End if().
489
+ }// End if().
490
+ }
491
+
492
+ /**
493
+ * Import first two Package Widgets to Pricing Section.
494
+ *
495
+ * @param array $widget_ids the ids of package widgets active inside sidebars.
496
+ */
497
+ function hestia_import_packages_widgets( $widget_ids ) {
498
+ $pricing_table_1_title = get_theme_mod( 'hestia_pricing_table_one_title' );
499
+ $pricing_table_1_price = get_theme_mod( 'hestia_pricing_table_one_price' );
500
+ $pricing_table_1_features = get_theme_mod( 'hestia_pricing_table_one_features' );
501
+ $pricing_table_1_link = get_theme_mod( 'hestia_pricing_table_one_link' );
502
+ $pricing_table_1_text = get_theme_mod( 'hestia_pricing_table_one_text' );
503
+
504
+ $pricing_table_2_title = get_theme_mod( 'hestia_pricing_table_two_title' );
505
+ $pricing_table_2_price = get_theme_mod( 'hestia_pricing_table_two_price' );
506
+ $pricing_table_2_features = get_theme_mod( 'hestia_pricing_table_two_features' );
507
+ $pricing_table_2_link = get_theme_mod( 'hestia_pricing_table_two_link' );
508
+ $pricing_table_2_text = get_theme_mod( 'hestia_pricing_table_two_text' );
509
+
510
+ if ( empty( $pricing_table_1_title ) && empty( $pricing_table_1_price ) && empty( $pricing_table_1_features ) && empty( $pricing_table_1_link ) && empty( $pricing_table_1_text ) && empty( $pricing_table_2_title ) && empty( $pricing_table_2_price ) && empty( $pricing_table_2_features ) && empty( $pricing_table_2_link ) && empty( $pricing_table_2_text ) ) {
511
+ if ( ! empty( $widget_ids ) ) {
512
+ $widgets_content = array();
513
+ $widgets = get_option( 'widget_color-picker' );
514
+ foreach ( $widget_ids as $widget_id ) {
515
+ array_push( $widgets_content, $widgets[ $widget_id ] );
516
+ }
517
+
518
+ hestia_import_pricing_package( 0, $widgets_content );
519
+ hestia_import_pricing_package( 1, $widgets_content );
520
+
521
+ }
522
+ }
523
+ }
524
+
525
+ /**
526
+ * Import Title and Subtitle for sections.
527
+ *
528
+ * @param array $content the content from previous zerif instance.
529
+ * @param string $zerif_key the theme mod name from zerif.
530
+ * @param string $hestia_key the theme mod name from hestia.
531
+ */
532
+ function hestia_import_customizer_setting( $content, $zerif_key, $hestia_key ) {
533
+ /* Set the theme mod in Hestia based on the imported content. */
534
+ $theme_mod = get_theme_mod( $hestia_key );
535
+ if ( empty( $theme_mod ) ) {
536
+ if ( ! empty( $content[ $zerif_key ] ) ) {
537
+ set_theme_mod( $hestia_key, $content[ $zerif_key ] );
538
+ }
539
+ }
540
+ }
541
+
542
+ /**
543
+ * Set theme mod based on widget key.
544
+ *
545
+ * @param string $hestia_theme_mod the theme mod name from hestia.
546
+ * @param string $widget_key the widget array element key.
547
+ */
548
+ function hestia_import_widget_to_setting( $hestia_theme_mod, $widget_key ) {
549
+ if ( ! empty( $widget_key ) ) {
550
+ set_theme_mod( $hestia_theme_mod, $widget_key );
551
+ }
552
+ }
553
+
554
+ /**
555
+ * Import a pricing package by ID
556
+ *
557
+ * @param string $id the pricing package id.
558
+ * @param array $widgets_content the widget content.
559
+ */
560
+ function hestia_import_pricing_package( $id, $widgets_content ) {
561
+ if ( ! empty( $widgets_content ) && ! empty( $widgets_content[ $id ] ) ) {
562
+ $price_field = '';
563
+ if ( ! empty( $widgets_content[ $id ]['currency'] ) ) {
564
+ $price_field .= '<small>' . $widgets_content[ $id ]['currency'] . '</small>';
565
+ }
566
+ if ( ! empty( $widgets_content[ $id ]['price'] ) ) {
567
+ $price_field .= $widgets_content[ $id ]['price'];
568
+ }
569
+ if ( ! empty( $widgets_content[ $id ]['price_meta'] ) ) {
570
+ $price_field .= '<small>' . $widgets_content[ $id ]['price_meta'] . '</small>';
571
+ }
572
+ $features_field = '';
573
+ for ( $i = 1; $i <= 10; $i ++ ) {
574
+ $feature = $widgets_content[ $id ][ 'item' . $i ];
575
+ if ( ! empty( $feature ) ) {
576
+ $features_field .= $feature . ' \n ';
577
+ }
578
+ }
579
+
580
+ if ( $id == 0 ) {
581
+ $theme_mod_prefix = 'hestia_pricing_table_one';
582
+ } else {
583
+ $theme_mod_prefix = 'hestia_pricing_table_two';
584
+ }
585
+
586
+ hestia_import_widget_to_setting( $theme_mod_prefix . '_title', $widgets_content[ $id ]['title'] );
587
+ hestia_import_widget_to_setting( $theme_mod_prefix . '_price', $price_field );
588
+ hestia_import_widget_to_setting( $theme_mod_prefix . '_features', $features_field );
589
+ hestia_import_widget_to_setting( $theme_mod_prefix . '_link', $widgets_content[ $id ]['button_link'] );
590
+ hestia_import_widget_to_setting( $theme_mod_prefix . '_text', $widgets_content[ $id ]['button_label'] );
591
+ }
592
+ }
593
+
594
+ /**
595
+ * About us section to front page content import.
596
+ *
597
+ * @param array $content the content from previous zerif instance.
598
+ * @param array $widget_ids the ids of clients widgets active inside sidebars.
599
+ */
600
+ function hestia_import_about_us_content( $content, $widget_ids ) {
601
+ /* Import the texts from "About Us" */
602
+ $about_content_theme_mod = get_theme_mod( 'hestia_page_editor' );
603
+ if ( empty( $about_content_theme_mod ) ) {
604
+
605
+ if ( ! empty( $content['zerif_aboutus_title'] ) ) {
606
+ $about_title = $content['zerif_aboutus_title'];
607
+ }
608
+ if ( ! empty( $content['zerif_aboutus_subtitle'] ) ) {
609
+ $about_subtitle = $content['zerif_aboutus_subtitle'];
610
+ }
611
+ if ( ! empty( $content['zerif_aboutus_biglefttitle'] ) ) {
612
+ $about_left_text = $content['zerif_aboutus_biglefttitle'];
613
+ }
614
+ if ( ! empty( $content['zerif_aboutus_text'] ) ) {
615
+ $about_content = $content['zerif_aboutus_text'];
616
+ }
617
+
618
+ $output = '';
619
+
620
+ /* Add About Title and / or subtitle if they exist. */
621
+ if ( ! empty( $about_title ) || ! empty( $about_subtitle ) ) {
622
+ $output .= '<div class="row"><div class="col-md-8 col-md-offset-2" style="text-align: center">';
623
+ if ( ! empty( $about_title ) ) {
624
+ $output .= '<h2 class="title">' . wp_kses_post( $about_title ) . '</h2>';
625
+ }
626
+ if ( ! empty( $about_subtitle ) ) {
627
+ $output .= '<h5 class="description">' . wp_kses_post( $about_subtitle ) . '</h5>';
628
+ }
629
+ $output .= '</div></div>';
630
+ }
631
+
632
+ /* Add About Big Text and / or content if they exist. */
633
+ if ( ! empty( $about_left_text ) || ! empty( $about_content ) ) {
634
+ $output .= '<div class="row">';
635
+ if ( ! empty( $about_left_text ) ) {
636
+ $output .= '<div class="col-md-6"><p style="font-size: 30px; text-align: right">' . wp_kses_post( $about_left_text ) . '</p></div>';
637
+ }
638
+ if ( ! empty( $about_content ) ) {
639
+ $output .= '<div class="col-md-6"><p>' . wp_kses_post( $about_content ) . '</p></div>';
640
+ }
641
+ $output .= '</div>';
642
+ }
643
+ if ( ! empty( $widget_ids ) ) {
644
+ $widgets_content = array();
645
+ $widgets = get_option( 'widget_zerif_clients-widget' );
646
+ foreach ( $widget_ids as $widget_id ) {
647
+ array_push( $widgets_content, $widgets[ $widget_id ] );
648
+ }
649
+
650
+ if ( ! empty( $widgets_content ) ) {
651
+ $output .= '<div class="row" style="text-align: center;">';
652
+ foreach ( $widgets_content as $widget_content ) {
653
+ if ( ! empty( $widget_content['image_uri'] ) ) {
654
+ $output .= '<div class="col-md-4">';
655
+ if ( ! empty( $widget_content['link'] ) ) {
656
+ $output .= '<a href="' . esc_url( $widget_content['link'] ) . '">';
657
+ }
658
+ $output .= '<img ';
659
+ if ( ! empty( $widget_content['title'] ) ) {
660
+ $output .= 'alt="' . esc_html( $widget_content['title'] ) . '" ';
661
+ }
662
+ $output .= 'src="' . esc_url( $widget_content['image_uri'] ) . '"';
663
+ $output .= '/>';
664
+ if ( ! empty( $widget_content['link'] ) ) {
665
+ $output .= '</a>';
666
+ }
667
+ $output .='</div>';
668
+ }
669
+ }
670
+ $output .= '</div>';
671
+ }
672
+ }
673
+ if ( ! empty( $output ) ) {
674
+ set_theme_mod( 'hestia_page_editor', wp_kses_post( $output ) );
675
+ }
676
+ }// End if().
677
+ }
inc/hestia/inc/sections/hestia-features-section.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Services section for the homepage.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Hestia
7
+ * @since Hestia 1.0
8
+ */
9
+
10
+ if ( ! function_exists( 'hestia_features' ) ) :
11
+ /**
12
+ * Features section content.
13
+ *
14
+ * @since Hestia 1.0
15
+ */
16
+ function hestia_features() {
17
+
18
+ $show_features_single_product = get_theme_mod( 'hestia_features_show_on_single_product', false );
19
+ $hide_section = get_theme_mod( 'hestia_features_hide', false );
20
+
21
+ if ( current_user_can('edit_theme_options' ) ) {
22
+ $hestia_features_title = get_theme_mod( 'hestia_features_title', esc_html__( 'Why our product is the best', 'themeisle-companion' ) );
23
+ $hestia_features_subtitle = get_theme_mod( 'hestia_features_subtitle', esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ) );
24
+ $hestia_features_content = get_theme_mod( 'hestia_features_content', json_encode( array(
25
+ array(
26
+ 'icon_value' => 'fa-wechat',
27
+ 'title' => esc_html__( 'Responsive', 'themeisle-companion' ),
28
+ 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ),
29
+ 'link' => '#',
30
+ 'color' => '#e91e63',
31
+ ),
32
+ array(
33
+ 'icon_value' => 'fa-check',
34
+ 'title' => esc_html__( 'Quality', 'themeisle-companion' ),
35
+ 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ),
36
+ 'link' => '#',
37
+ 'color' => '#00bcd4',
38
+ ),
39
+ array(
40
+ 'icon_value' => 'fa-support',
41
+ 'title' => esc_html__( 'Support', 'themeisle-companion' ),
42
+ 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ),
43
+ 'link' => '#',
44
+ 'color' => '#4caf50',
45
+ ),
46
+ ) ) );
47
+ } else {
48
+ $hestia_features_title = get_theme_mod( 'hestia_features_title' );
49
+ $hestia_features_subtitle = get_theme_mod( 'hestia_features_subtitle' );
50
+ $hestia_features_content = get_theme_mod( 'hestia_features_content' );
51
+ }
52
+
53
+ if ( ( ( is_single() && ( (bool) $show_features_single_product === false ) ) || ( is_front_page() && ( (bool) $hide_section === true ) ) ) || ( ( empty( $hestia_features_title ) ) && ( empty( $hestia_features_subtitle ) ) && ( empty( $hestia_features_content ) ) ) ) {
54
+ return;
55
+ }
56
+ ?>
57
+ <section class="features" id="features" data-sorder="hestia_features">
58
+ <div class="container">
59
+ <div class="row">
60
+ <div class="col-md-8 col-md-offset-2">
61
+ <?php if ( ! empty( $hestia_features_title ) || is_customize_preview() ) : ?>
62
+ <h2 class="title"><?php echo esc_html( $hestia_features_title ); ?></h2>
63
+ <?php endif; ?>
64
+ <?php if ( ! empty( $hestia_features_subtitle ) || is_customize_preview() ) : ?>
65
+ <h5 class="description"><?php echo esc_html( $hestia_features_subtitle ); ?></h5>
66
+ <?php endif; ?>
67
+ </div>
68
+ </div>
69
+ <div class="row">
70
+ <?php
71
+ if ( ! empty( $hestia_features_content ) ) :
72
+ $hestia_features_content = json_decode( $hestia_features_content );
73
+ foreach ( $hestia_features_content as $features_item ) :
74
+ $icon = ! empty( $features_item->icon_value ) ? apply_filters( 'hestia_translate_single_string', $features_item->icon_value, 'Features section' ) : '';
75
+ $title = ! empty( $features_item->title ) ? apply_filters( 'hestia_translate_single_string', $features_item->title, 'Features section' ) : '';
76
+ $text = ! empty( $features_item->text ) ? apply_filters( 'hestia_translate_single_string', $features_item->text, 'Features section' ) : '';
77
+ $link = ! empty( $features_item->link ) ? apply_filters( 'hestia_translate_single_string', $features_item->link, 'Features section' ) : '';
78
+ ?>
79
+ <div class="col-md-4 feature-box">
80
+ <div class="info">
81
+ <?php if ( ! empty( $link ) ) : ?>
82
+ <a href="<?php echo esc_url( $link ); ?>">
83
+ <?php endif; ?>
84
+ <?php if ( ! empty( $icon ) ) : ?>
85
+ <div class="icon">
86
+ <i class="fa <?php echo esc_html( $icon ); ?>"></i>
87
+ </div>
88
+ <?php endif; ?>
89
+ <?php if ( ! empty( $title ) ) : ?>
90
+ <h4 class="info-title"><?php echo esc_html( $title ); ?></h4>
91
+ <?php endif; ?>
92
+ <?php if ( ! empty( $link ) ) : ?>
93
+ </a>
94
+ <?php endif; ?>
95
+ <?php if ( ! empty( $text ) ) : ?>
96
+ <p><?php echo esc_html( $text ); ?></p>
97
+ <?php endif; ?>
98
+ </div>
99
+ </div>
100
+ <?php
101
+ endforeach;
102
+ endif;
103
+ ?>
104
+ </div>
105
+ </div>
106
+ </section>
107
+ <?php
108
+ }
109
+
110
+ endif;
111
+
112
+ if ( ! function_exists( 'hestia_features_register_strings' ) ) {
113
+ /**
114
+ * Register polylang strings
115
+ */
116
+ function hestia_features_register_strings() {
117
+ $default = json_encode( array(
118
+ array(
119
+ 'icon_value' => 'fa-wechat',
120
+ 'title' => esc_html__( 'Responsive', 'themeisle-companion' ),
121
+ 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ),
122
+ 'link' => '#',
123
+ 'color' => '#e91e63',
124
+ ),
125
+ array(
126
+ 'icon_value' => 'fa-check',
127
+ 'title' => esc_html__( 'Quality', 'themeisle-companion' ),
128
+ 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ),
129
+ 'link' => '#',
130
+ 'color' => '#00bcd4',
131
+ ),
132
+ array(
133
+ 'icon_value' => 'fa-support',
134
+ 'title' => esc_html__( 'Support', 'themeisle-companion' ),
135
+ 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ),
136
+ 'link' => '#',
137
+ 'color' => '#4caf50',
138
+ ),
139
+ ) );
140
+
141
+ hestia_pll_string_register_helper( 'hestia_features_content', $default, 'Features section' );
142
+ }
143
+ }
144
+
145
+ if ( function_exists( 'hestia_features' ) ) {
146
+ $section_priority = apply_filters( 'hestia_section_priority', 10, 'hestia_features' );
147
+ add_action( 'hestia_sections', 'hestia_features', absint( $section_priority ) );
148
+ add_action( 'after_setup_theme', 'hestia_features_register_strings', 11 );
149
+ }
inc/hestia/inc/sections/hestia-team-section.php ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Team section for the homepage.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Hestia
7
+ * @since Hestia 1.0
8
+ */
9
+
10
+ if ( ! function_exists( 'hestia_team' ) ) :
11
+ /**
12
+ * Team section content.
13
+ *
14
+ * @since Hestia 1.0
15
+ */
16
+ function hestia_team() {
17
+
18
+ if ( current_user_can('edit_theme_options' ) ) {
19
+ $hestia_team_title = get_theme_mod( 'hestia_team_title', esc_html__( 'Meet our team', 'themeisle-companion' ) );
20
+ $hestia_team_subtitle = get_theme_mod( 'hestia_team_subtitle', esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ) );
21
+ $hestia_team_content = get_theme_mod( 'hestia_team_content', json_encode( array(
22
+ array(
23
+ 'image_url' => get_template_directory_uri() . '/assets/img/1.jpg',
24
+ 'title' => esc_html__( 'Desmond Purpleson', 'themeisle-companion' ),
25
+ 'subtitle' => esc_html__( 'CEO', 'themeisle-companion' ),
26
+ 'text' => esc_html__( 'Locavore pinterest chambray affogato art party, forage coloring book typewriter. Bitters cold selfies, retro celiac sartorial mustache.', 'themeisle-companion' ),
27
+ 'id' => 'customizer_repeater_56d7ea7f40c56',
28
+ 'social_repeater' => json_encode( array(
29
+ array(
30
+ 'id' => 'customizer-repeater-social-repeater-57fb908674e06',
31
+ 'link' => 'facebook.com',
32
+ 'icon' => 'fa-facebook',
33
+ ),
34
+ array(
35
+ 'id' => 'customizer-repeater-social-repeater-57fb9148530ft',
36
+ 'link' => 'plus.google.com',
37
+ 'icon' => 'fa-google-plus',
38
+ ),
39
+ array(
40
+ 'id' => 'customizer-repeater-social-repeater-57fb9148530fc',
41
+ 'link' => 'twitter.com',
42
+ 'icon' => 'fa-twitter',
43
+ ),
44
+ array(
45
+ 'id' => 'customizer-repeater-social-repeater-57fb9150e1e89',
46
+ 'link' => 'linkedin.com',
47
+ 'icon' => 'fa-linkedin',
48
+ ),
49
+ ) ),
50
+ ),
51
+ array(
52
+ 'image_url' => get_template_directory_uri() . '/assets/img/2.jpg',
53
+ 'title' => esc_html__( 'Parsley Pepperspray', 'themeisle-companion' ),
54
+ 'subtitle' => esc_html__( 'Marketing Specialist', 'themeisle-companion' ),
55
+ 'text' => esc_html__( 'Craft beer salvia celiac mlkshk. Pinterest celiac tumblr, portland salvia skateboard cliche thundercats. Tattooed chia austin hell.', 'themeisle-companion' ),
56
+ 'id' => 'customizer_repeater_56d7ea7f40c66',
57
+ 'social_repeater' => json_encode( array(
58
+ array(
59
+ 'id' => 'customizer-repeater-social-repeater-57fb9155a1072',
60
+ 'link' => 'facebook.com',
61
+ 'icon' => 'fa-facebook',
62
+ ),
63
+ array(
64
+ 'id' => 'customizer-repeater-social-repeater-57fb9160ab683',
65
+ 'link' => 'twitter.com',
66
+ 'icon' => 'fa-twitter',
67
+ ),
68
+ array(
69
+ 'id' => 'customizer-repeater-social-repeater-57fb9160ab484',
70
+ 'link' => 'pinterest.com',
71
+ 'icon' => 'fa-pinterest',
72
+ ),
73
+ array(
74
+ 'id' => 'customizer-repeater-social-repeater-57fb916ddffc9',
75
+ 'link' => 'linkedin.com',
76
+ 'icon' => 'fa-linkedin',
77
+ ),
78
+ ) ),
79
+ ),
80
+ array(
81
+ 'image_url' => get_template_directory_uri() . '/assets/img/3.jpg',
82
+ 'title' => esc_html__( 'Desmond Eagle', 'themeisle-companion' ),
83
+ 'subtitle' => esc_html__( 'Graphic Designer', 'themeisle-companion' ),
84
+ 'text' => esc_html__( 'Pok pok direct trade godard street art, poutine fam typewriter food truck narwhal kombucha wolf cardigan butcher whatever pickled you.', 'themeisle-companion' ),
85
+ 'id' => 'customizer_repeater_56d7ea7f40c76',
86
+ 'social_repeater' => json_encode( array(
87
+ array(
88
+ 'id' => 'customizer-repeater-social-repeater-57fb917e4c69e',
89
+ 'link' => 'facebook.com',
90
+ 'icon' => 'fa-facebook',
91
+ ),
92
+ array(
93
+ 'id' => 'customizer-repeater-social-repeater-57fb91830825c',
94
+ 'link' => 'twitter.com',
95
+ 'icon' => 'fa-twitter',
96
+ ),
97
+ array(
98
+ 'id' => 'customizer-repeater-social-repeater-57fb918d65f2e',
99
+ 'link' => 'linkedin.com',
100
+ 'icon' => 'fa-linkedin',
101
+ ),
102
+ array(
103
+ 'id' => 'customizer-repeater-social-repeater-57fb918d65f2x',
104
+ 'link' => 'dribbble.com',
105
+ 'icon' => 'fa-dribbble',
106
+ ),
107
+ ) ),
108
+ ),
109
+ array(
110
+ 'image_url' => get_template_directory_uri() . '/assets/img/4.jpg',
111
+ 'title' => esc_html__( 'Ruby Von Rails', 'themeisle-companion' ),
112
+ 'subtitle' => esc_html__( 'Lead Developer', 'themeisle-companion' ),
113
+ 'text' => esc_html__( 'Small batch vexillologist 90\'s blue bottle stumptown bespoke. Pok pok tilde fixie chartreuse, VHS gluten-free selfies wolf hot.', 'themeisle-companion' ),
114
+ 'id' => 'customizer_repeater_56d7ea7f40c86',
115
+ 'social_repeater' => json_encode( array(
116
+ array(
117
+ 'id' => 'customizer-repeater-social-repeater-57fb925cedcg5',
118
+ 'link' => 'github.com',
119
+ 'icon' => 'fa-github-square',
120
+ ),
121
+ array(
122
+ 'id' => 'customizer-repeater-social-repeater-57fb925cedcb2',
123
+ 'link' => 'facebook.com',
124
+ 'icon' => 'fa-facebook',
125
+ ),
126
+ array(
127
+ 'id' => 'customizer-repeater-social-repeater-57fb92615f030',
128
+ 'link' => 'twitter.com',
129
+ 'icon' => 'fa-twitter',
130
+ ),
131
+ array(
132
+ 'id' => 'customizer-repeater-social-repeater-57fb9266c223a',
133
+ 'link' => 'linkedin.com',
134
+ 'icon' => 'fa-linkedin',
135
+ ),
136
+ ) ),
137
+ ),
138
+ ) ) );
139
+ } else {
140
+ $hestia_team_title = get_theme_mod( 'hestia_team_title' );
141
+ $hestia_team_subtitle = get_theme_mod( 'hestia_team_subtitle' );
142
+ $hestia_team_content = get_theme_mod( 'hestia_team_content' );
143
+ }// End if().
144
+
145
+ $hide_section = get_theme_mod( 'hestia_team_hide', false );
146
+ if ( ( (bool) $hide_section === true ) || ( empty( $hestia_team_title ) && empty( $hestia_team_subtitle ) && empty( $hestia_team_content ) ) ) {
147
+ return;
148
+ }
149
+
150
+ ?>
151
+ <section class="team" id="team" data-sorder="hestia_team">
152
+ <div class="container">
153
+ <div class="row">
154
+ <div class="col-md-8 col-md-offset-2 text-center">
155
+ <?php if ( ! empty( $hestia_team_title ) || is_customize_preview() ) : ?>
156
+ <h2 class="title"><?php echo esc_html( $hestia_team_title ); ?></h2>
157
+ <?php endif; ?>
158
+ <?php if ( ! empty( $hestia_team_subtitle ) || is_customize_preview() ) : ?>
159
+ <h5 class="description"><?php echo esc_html( $hestia_team_subtitle ); ?></h5>
160
+ <?php endif; ?>
161
+ </div>
162
+ </div>
163
+ <div class="row">
164
+ <?php
165
+ if ( ! empty( $hestia_team_content ) ) :
166
+ $hestia_team_content = json_decode( $hestia_team_content );
167
+ foreach ( $hestia_team_content as $team_item ) :
168
+ $image = ! empty( $team_item->image_url ) ? apply_filters( 'hestia_translate_single_string', $team_item->image_url, 'Team section' ) : '';
169
+ $title = ! empty( $team_item->title ) ? apply_filters( 'hestia_translate_single_string', $team_item->title, 'Team section' ) : '';
170
+ $subtitle = ! empty( $team_item->subtitle ) ? apply_filters( 'hestia_translate_single_string', $team_item->subtitle, 'Team section' ) : '';
171
+ $text = ! empty( $team_item->text ) ? apply_filters( 'hestia_translate_single_string', $team_item->text, 'Team section' ) : '';
172
+ $link = ! empty( $team_item->link ) ? apply_filters( 'hestia_translate_single_string', $team_item->link, 'Team section' ) : '';
173
+ ?>
174
+ <div class="col-md-6">
175
+ <div class="card card-profile card-plain">
176
+ <div class="col-md-5">
177
+ <div class="card-image">
178
+ <?php if ( ! empty( $image ) ) : ?>
179
+ <?php if ( ! empty( $link ) ) : ?>
180
+ <a href="<?php echo esc_url( $link ); ?>">
181
+ <?php endif; ?>
182
+ <img class="img"
183
+ src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
184
+ <?php if ( ! empty( $link ) ) : ?>
185
+ </a>
186
+ <?php endif; ?>
187
+ <?php endif; ?>
188
+ </div>
189
+ </div>
190
+ <div class="col-md-7">
191
+ <div class="content">
192
+ <?php if ( ! empty( $title ) ) : ?>
193
+ <h4 class="card-title"><?php echo esc_html( $title ); ?></h4>
194
+ <?php endif; ?>
195
+ <?php if ( ! empty( $subtitle ) ) : ?>
196
+ <h6 class="category text-muted"><?php echo esc_html( $subtitle ); ?></h6>
197
+ <?php endif; ?>
198
+ <?php if ( ! empty( $text ) ) : ?>
199
+ <p class="card-description"><?php echo esc_html( $text ); ?></p>
200
+ <?php endif; ?>
201
+ <?php
202
+ if ( ! empty( $team_item->social_repeater ) ) :
203
+ $icons = html_entity_decode( $team_item->social_repeater );
204
+ $icons_decoded = json_decode( $icons, true );
205
+ if ( ! empty( $icons_decoded ) ) :
206
+ ?>
207
+ <div class="footer">
208
+ <?php foreach ( $icons_decoded as $value ) :
209
+ $social_icon = ! empty( $value['icon'] ) ? apply_filters( 'hestia_translate_single_string', $value['icon'], 'Team section' ) : '';
210
+ $social_link = ! empty( $value['link'] ) ? apply_filters( 'hestia_translate_single_string', $value['link'], 'Team section' ) : '';
211
+ ?>
212
+ <?php if ( ! empty( $social_icon ) ) : ?>
213
+ <a href="<?php echo esc_url( $social_link ); ?>"
214
+ class="btn btn-just-icon btn-simple">
215
+ <i class="fa <?php echo esc_attr( $social_icon ); ?>"></i>
216
+ </a>
217
+ <?php endif; ?>
218
+ <?php endforeach; ?>
219
+ </div>
220
+ <?php
221
+ endif;
222
+ endif;
223
+ ?>
224
+ </div>
225
+ </div>
226
+ </div>
227
+ </div>
228
+ <?php
229
+ endforeach;
230
+ endif;
231
+ ?>
232
+ </div>
233
+ </div>
234
+ </section>
235
+ <?php
236
+ }
237
+ endif;
238
+
239
+ if ( ! function_exists( 'hestia_team_register_strings' ) ) {
240
+ /**
241
+ * Register polylang strings
242
+ */
243
+ function hestia_team_register_strings() {
244
+ $default = json_encode( array(
245
+ array(
246
+ 'image_url' => get_template_directory_uri() . '/assets/img/1.jpg',
247
+ 'title' => esc_html__( 'Desmond Purpleson', 'themeisle-companion' ),
248
+ 'subtitle' => esc_html__( 'CEO', 'themeisle-companion' ),
249
+ 'text' => esc_html__( 'Locavore pinterest chambray affogato art party, forage coloring book typewriter. Bitters cold selfies, retro celiac sartorial mustache.', 'themeisle-companion' ),
250
+ 'id' => 'customizer_repeater_56d7ea7f40c56',
251
+ 'social_repeater' => json_encode( array(
252
+ array(
253
+ 'id' => 'customizer-repeater-social-repeater-57fb908674e06',
254
+ 'link' => 'facebook.com',
255
+ 'icon' => 'fa-facebook',
256
+ ),
257
+ array(
258
+ 'id' => 'customizer-repeater-social-repeater-57fb9148530ft',
259
+ 'link' => 'plus.google.com',
260
+ 'icon' => 'fa-google-plus',
261
+ ),
262
+ array(
263
+ 'id' => 'customizer-repeater-social-repeater-57fb9148530fc',
264
+ 'link' => 'twitter.com',
265
+ 'icon' => 'fa-twitter',
266
+ ),
267
+ array(
268
+ 'id' => 'customizer-repeater-social-repeater-57fb9150e1e89',
269
+ 'link' => 'linkedin.com',
270
+ 'icon' => 'fa-linkedin',
271
+ ),
272
+ ) ),
273
+ ),
274
+ array(
275
+ 'image_url' => get_template_directory_uri() . '/assets/img/2.jpg',
276
+ 'title' => esc_html__( 'Parsley Pepperspray', 'themeisle-companion' ),
277
+ 'subtitle' => esc_html__( 'Marketing Specialist', 'themeisle-companion' ),
278
+ 'text' => esc_html__( 'Craft beer salvia celiac mlkshk. Pinterest celiac tumblr, portland salvia skateboard cliche thundercats. Tattooed chia austin hell.', 'themeisle-companion' ),
279
+ 'id' => 'customizer_repeater_56d7ea7f40c66',
280
+ 'social_repeater' => json_encode( array(
281
+ array(
282
+ 'id' => 'customizer-repeater-social-repeater-57fb9155a1072',
283
+ 'link' => 'facebook.com',
284
+ 'icon' => 'fa-facebook',
285
+ ),
286
+ array(
287
+ 'id' => 'customizer-repeater-social-repeater-57fb9160ab683',
288
+ 'link' => 'twitter.com',
289
+ 'icon' => 'fa-twitter',
290
+ ),
291
+ array(
292
+ 'id' => 'customizer-repeater-social-repeater-57fb9160ab484',
293
+ 'link' => 'pinterest.com',
294
+ 'icon' => 'fa-pinterest',
295
+ ),
296
+ array(
297
+ 'id' => 'customizer-repeater-social-repeater-57fb916ddffc9',
298
+ 'link' => 'linkedin.com',
299
+ 'icon' => 'fa-linkedin',
300
+ ),
301
+ ) ),
302
+ ),
303
+ array(
304
+ 'image_url' => get_template_directory_uri() . '/assets/img/3.jpg',
305
+ 'title' => esc_html__( 'Desmond Eagle', 'themeisle-companion' ),
306
+ 'subtitle' => esc_html__( 'Graphic Designer', 'themeisle-companion' ),
307
+ 'text' => esc_html__( 'Pok pok direct trade godard street art, poutine fam typewriter food truck narwhal kombucha wolf cardigan butcher whatever pickled you.', 'themeisle-companion' ),
308
+ 'id' => 'customizer_repeater_56d7ea7f40c76',
309
+ 'social_repeater' => json_encode( array(
310
+ array(
311
+ 'id' => 'customizer-repeater-social-repeater-57fb917e4c69e',
312
+ 'link' => 'facebook.com',
313
+ 'icon' => 'fa-facebook',
314
+ ),
315
+ array(
316
+ 'id' => 'customizer-repeater-social-repeater-57fb91830825c',
317
+ 'link' => 'twitter.com',
318
+ 'icon' => 'fa-twitter',
319
+ ),
320
+ array(
321
+ 'id' => 'customizer-repeater-social-repeater-57fb918d65f2e',
322
+ 'link' => 'linkedin.com',
323
+ 'icon' => 'fa-linkedin',
324
+ ),
325
+ array(
326
+ 'id' => 'customizer-repeater-social-repeater-57fb918d65f2x',
327
+ 'link' => 'dribbble.com',
328
+ 'icon' => 'fa-dribbble',
329
+ ),
330
+ ) ),
331
+ ),
332
+ array(
333
+ 'image_url' => get_template_directory_uri() . '/assets/img/4.jpg',
334
+ 'title' => esc_html__( 'Ruby Von Rails', 'themeisle-companion' ),
335
+ 'subtitle' => esc_html__( 'Lead Developer', 'themeisle-companion' ),
336
+ 'text' => esc_html__( 'Small batch vexillologist 90\'s blue bottle stumptown bespoke. Pok pok tilde fixie chartreuse, VHS gluten-free selfies wolf hot.', 'themeisle-companion' ),
337
+ 'id' => 'customizer_repeater_56d7ea7f40c86',
338
+ 'social_repeater' => json_encode( array(
339
+ array(
340
+ 'id' => 'customizer-repeater-social-repeater-57fb925cedcg5',
341
+ 'link' => 'github.com',
342
+ 'icon' => 'fa-github-square',
343
+ ),
344
+ array(
345
+ 'id' => 'customizer-repeater-social-repeater-57fb925cedcb2',
346
+ 'link' => 'facebook.com',
347
+ 'icon' => 'fa-facebook',
348
+ ),
349
+ array(
350
+ 'id' => 'customizer-repeater-social-repeater-57fb92615f030',
351
+ 'link' => 'twitter.com',
352
+ 'icon' => 'fa-twitter',
353
+ ),
354
+ array(
355
+ 'id' => 'customizer-repeater-social-repeater-57fb9266c223a',
356
+ 'link' => 'linkedin.com',
357
+ 'icon' => 'fa-linkedin',
358
+ ),
359
+ ) ),
360
+ ),
361
+ ) );
362
+
363
+ hestia_pll_string_register_helper( 'hestia_team_content', $default, 'Team section' );
364
+ }
365
+ }// End if().
366
+
367
+ if ( function_exists( 'hestia_team' ) ) {
368
+ $section_priority = apply_filters( 'hestia_section_priority', 30, 'hestia_team' );
369
+ add_action( 'hestia_sections', 'hestia_team', absint( $section_priority ) );
370
+ add_action( 'after_setup_theme', 'hestia_team_register_strings', 11 );
371
+ }
inc/hestia/inc/sections/hestia-testimonials-section.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Testimonials section for the homepage.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Hestia
7
+ * @since Hestia 1.0
8
+ */
9
+
10
+ if ( ! function_exists( 'hestia_testimonials' ) ) :
11
+ /**
12
+ * Testimonials section content.
13
+ *
14
+ * @since Hestia 1.0
15
+ */
16
+ function hestia_testimonials() {
17
+
18
+ if ( current_user_can('edit_theme_options' ) ) {
19
+ $hestia_testimonials_title = get_theme_mod( 'hestia_testimonials_title', esc_html__( 'What clients say', 'themeisle-companion' ) );
20
+ $hestia_testimonials_subtitle = get_theme_mod( 'hestia_testimonials_subtitle', esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'themeisle-companion' ) );
21
+ $hestia_testimonials_content = get_theme_mod( 'hestia_testimonials_content', json_encode( array(
22
+ array(
23
+ 'image_url' => get_template_directory_uri() . '/assets/img/5.jpg',
24
+ 'title' => esc_html__( 'Inverness McKenzie', 'themeisle-companion' ),
25
+ 'subtitle' => esc_html__( 'Business Owner', 'themeisle-companion' ),
26
+ 'text' => esc_html__( '"We have no regrets! After using your product my business skyrocketed! I made back the purchase price in just 48 hours! I couldn\'t have asked for more than this."', 'themeisle-companion' ),
27
+ 'id' => 'customizer_repeater_56d7ea7f40d56',
28
+ ),
29
+ array(
30
+ 'image_url' => get_template_directory_uri() . '/assets/img/6.jpg',
31
+ 'title' => esc_html__( 'Hanson Deck', 'themeisle-companion' ),
32
+ 'subtitle' => esc_html__( 'Independent Artist', 'themeisle-companion' ),
33
+ 'text' => esc_html__( '"Your company is truly upstanding and is behind its product 100 percent. Hestia is worth much more than I paid. I like Hestia more each day because it makes easier."', 'themeisle-companion' ),
34
+ 'id' => 'customizer_repeater_56d7ea7f40d66',
35
+ ),
36
+ array(
37
+ 'image_url' => get_template_directory_uri() . '/assets/img/7.jpg',
38
+ 'title' => esc_html__( 'Natalya Undergrowth', 'themeisle-companion' ),
39
+ 'subtitle' => esc_html__( 'Freelancer', 'themeisle-companion' ),
40
+ 'text' => esc_html__( '"Thank you for making it painless, pleasant and most of all hassle free! I am so pleased with this product. Dude, your stuff is great! I will refer everyone I know."', 'themeisle-companion' ),
41
+ 'id' => 'customizer_repeater_56d7ea7f40d76',
42
+ ),
43
+ ) ) );
44
+ } else {
45
+ $hestia_testimonials_title = get_theme_mod( 'hestia_testimonials_title' );
46
+ $hestia_testimonials_subtitle = get_theme_mod( 'hestia_testimonials_subtitle' );
47
+ $hestia_testimonials_content = get_theme_mod( 'hestia_testimonials_content' );
48
+ }
49
+
50
+ $hide_section = get_theme_mod( 'hestia_testimonials_hide', false );
51
+ if ( ( (bool) $hide_section === true ) || ( empty( $hestia_testimonials_title ) && empty( $hestia_testimonials_subtitle ) && empty( $hestia_testimonials_content ) ) ) {
52
+ return;
53
+ }
54
+
55
+ ?>
56
+ <section class="testimonials" id="testimonials" data-sorder="hestia_testimonials">
57
+ <div class="container">
58
+ <div class="row">
59
+ <div class="col-md-8 col-md-offset-2 text-center">
60
+ <?php if ( ! empty( $hestia_testimonials_title ) || is_customize_preview() ) : ?>
61
+ <h2 class="title"><?php echo esc_html( $hestia_testimonials_title ); ?></h2>
62
+ <?php endif; ?>
63
+ <?php if ( ! empty( $hestia_testimonials_subtitle ) || is_customize_preview() ) : ?>
64
+ <h5 class="description"><?php echo esc_html( $hestia_testimonials_subtitle ); ?></h5>
65
+ <?php endif; ?>
66
+ </div>
67
+ </div>
68
+ <div class="row">
69
+ <?php
70
+ if ( ! empty( $hestia_testimonials_content ) ) :
71
+ $hestia_testimonials_content = json_decode( $hestia_testimonials_content );
72
+ foreach ( $hestia_testimonials_content as $testimonial_item ) :
73
+ $image = ! empty( $testimonial_item->image_url ) ? apply_filters( 'hestia_translate_single_string', $testimonial_item->image_url, 'Testimonials section' ) : '';
74
+ $title = ! empty( $testimonial_item->title ) ? apply_filters( 'hestia_translate_single_string', $testimonial_item->title, 'Testimonials section' ) : '';
75
+ $subtitle = ! empty( $testimonial_item->subtitle ) ? apply_filters( 'hestia_translate_single_string', $testimonial_item->subtitle, 'Testimonials section' ) : '';
76
+ $text = ! empty( $testimonial_item->text ) ? apply_filters( 'hestia_translate_single_string', $testimonial_item->text, 'Testimonials section' ) : '';
77
+ $link = ! empty( $testimonial_item->link ) ? apply_filters( 'hestia_translate_single_string', $testimonial_item->link, 'Testimonials section' ) : '';
78
+ ?>
79
+ <div class="col-md-4">
80
+ <div class="card card-testimonial card-plain">
81
+ <?php if ( ! empty( $image ) ) : ?>
82
+ <div class="card-avatar">
83
+ <?php if ( ! empty( $link ) ) : ?>
84
+ <a href="<?php echo esc_url( $link ); ?>">
85
+ <?php endif; ?>
86
+ <img class="img"
87
+ src="<?php echo esc_url( $image ); ?>" <?php if ( ! empty( $title ) ) : ?> alt="<?php echo esc_attr( $title ); ?>" title="<?php echo esc_attr( $title ); ?>" <?php endif; ?> />
88
+ <?php if ( ! empty( $link ) ) : ?>
89
+ </a>
90
+ <?php endif; ?>
91
+ </div>
92
+ <?php endif; ?>
93
+ <div class="content">
94
+ <?php if ( ! empty( $title ) ) : ?>
95
+ <h4 class="card-title"><?php echo esc_html( $title ); ?></h4>
96
+ <?php endif; ?>
97
+ <?php if ( ! empty( $subtitle ) ) : ?>
98
+ <h6 class="category text-muted"><?php echo esc_html( $subtitle ); ?></h6>
99
+ <?php endif; ?>
100
+ <?php if ( ! empty( $text ) ) : ?>
101
+ <p class="card-description"><?php echo esc_html( $text ); ?></p>
102
+ <?php endif; ?>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ <?php
107
+ endforeach;
108
+ endif;
109
+ ?>
110
+ </div>
111
+ </div>
112
+ </section>
113
+ <?php
114
+ }
115
+ endif;
116
+
117
+ if ( ! function_exists( 'hestia_testimonials_register_strings' ) ) {
118
+ /**
119
+ * Register polylang strings
120
+ */
121
+ function hestia_testimonials_register_strings() {
122
+ $default = json_encode( array(
123
+ array(
124
+ 'image_url' => get_template_directory_uri() . '/assets/img/5.jpg',
125
+ 'title' => esc_html__( 'Inverness McKenzie', 'themeisle-companion' ),
126
+ 'subtitle' => esc_html__( 'Business Owner', 'themeisle-companion' ),
127
+ 'text' => esc_html__( '"We have no regrets! After using your product my business skyrocketed! I made back the purchase price in just 48 hours! I couldn\'t have asked for more than this."', 'themeisle-companion' ),
128
+ 'id' => 'customizer_repeater_56d7ea7f40d56',
129
+ ),
130
+ array(
131
+ 'image_url' => get_template_directory_uri() . '/assets/img/6.jpg',
132
+ 'title' => esc_html__( 'Hanson Deck', 'themeisle-companion' ),
133
+ 'subtitle' => esc_html__( 'Independent Artist', 'themeisle-companion' ),
134
+ 'text' => esc_html__( '"Your company is truly upstanding and is behind its product 100 percent. Hestia is worth much more than I paid. I like Hestia more each day because it makes easier."', 'themeisle-companion' ),
135
+ 'id' => 'customizer_repeater_56d7ea7f40d66',
136
+ ),
137
+ array(
138
+ 'image_url' => get_template_directory_uri() . '/assets/img/7.jpg',
139
+ 'title' => esc_html__( 'Natalya Undergrowth', 'themeisle-companion' ),
140
+ 'subtitle' => esc_html__( 'Freelancer', 'themeisle-companion' ),
141
+ 'text' => esc_html__( '"Thank you for making it painless, pleasant and most of all hassle free! I am so pleased with this product. Dude, your stuff is great! I will refer everyone I know."', 'themeisle-companion' ),
142
+ 'id' => 'customizer_repeater_56d7ea7f40d76',
143
+ ),
144
+ ) );
145
+
146
+ hestia_pll_string_register_helper( 'hestia_testimonials_content', $default, 'Testimonials section' );
147
+ }
148
+ }
149
+
150
+ if ( function_exists( 'hestia_testimonials' ) ) {
151
+ $section_priority = apply_filters( 'hestia_section_priority', 40, 'hestia_testimonials' );
152
+ add_action( 'hestia_sections', 'hestia_testimonials', absint( $section_priority ) );
153
+ add_action( 'after_setup_theme', 'hestia_testimonials_register_strings', 11 );
154
+ }
inc/zerif-lite/widgets/widget-clients.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Clients Widget
4
+ *
5
+ * @since 1.0.0
6
+ *
7
+ * @package themeisle-companion
8
+ */
9
+
10
+
11
+ /**
12
+ * Class zerif_clients_widget
13
+ */
14
+ if ( !class_exists( 'zerif_clients_widget' ) ) {
15
+
16
+ class zerif_clients_widget extends WP_Widget {
17
+
18
+ /**
19
+ * zerif_clients_widget constructor.
20
+ */
21
+ public function __construct() {
22
+ parent::__construct(
23
+ 'zerif_clients-widget',
24
+ __( 'Zerif - Clients widget', 'zerif-lite' ),
25
+ array(
26
+ 'customize_selective_refresh' => true,
27
+ )
28
+ );
29
+ add_action( 'admin_enqueue_scripts', array( $this, 'widget_scripts' ) );
30
+ }
31
+
32
+ /**
33
+ * Enqueue Widget Scripts
34
+ *
35
+ * @param $hook
36
+ */
37
+ function widget_scripts( $hook ) {
38
+ if ( $hook != 'widgets.php' ) {
39
+ return;
40
+ }
41
+ wp_enqueue_media();
42
+ wp_enqueue_script( 'zerif_widget_media_script', THEMEISLE_COMPANION_URL . 'assets/js/widget-media.js', false, '1.1', true );
43
+ }
44
+
45
+ /**
46
+ * Display Widget
47
+ *
48
+ * @param $args
49
+ * @param $instance
50
+ */
51
+ function widget( $args, $instance ) {
52
+
53
+ extract( $args );
54
+
55
+ echo $before_widget;
56
+
57
+ ?>
58
+
59
+ <a href="<?php if ( ! empty( $instance['link'] ) ): echo apply_filters( 'widget_title', $instance['link'] ); endif; ?>">
60
+ <?php
61
+ if ( ! empty( $instance['image_uri'] ) && ( $instance['image_uri'] != 'Upload Image' ) ) {
62
+
63
+ echo '<img src="' . esc_url( $instance['image_uri'] ) . '" alt="' . __( 'Client', 'zerif-lite' ) . '">';
64
+
65
+ } elseif ( ! empty( $instance['custom_media_id'] ) ) {
66
+
67
+ $zerif_clients_custom_media_id = wp_get_attachment_image_src( $instance["custom_media_id"] );
68
+ if ( ! empty( $zerif_clients_custom_media_id ) && ! empty( $zerif_clients_custom_media_id[0] ) ) {
69
+
70
+ echo '<img src="' . esc_url( $zerif_clients_custom_media_id[0] ) . '" alt="' . __( 'Client', 'zerif-lite' ) . '">';
71
+
72
+ }
73
+ }
74
+ ?>
75
+ </a>
76
+
77
+ <?php
78
+
79
+ echo $after_widget;
80
+
81
+ }
82
+
83
+ /**
84
+ * Update Widget
85
+ *
86
+ * @param $new_instance
87
+ * @param $old_instance
88
+ *
89
+ * @return mixed
90
+ */
91
+ function update( $new_instance, $old_instance ) {
92
+
93
+ $instance = $old_instance;
94
+
95
+ $instance['link'] = strip_tags( $new_instance['link'] );
96
+
97
+ $instance['image_uri'] = strip_tags( $new_instance['image_uri'] );
98
+
99
+ $instance['image_in_customizer'] = strip_tags( $new_instance['image_in_customizer'] );
100
+
101
+ $instance['custom_media_id'] = strip_tags( $new_instance['custom_media_id'] );
102
+
103
+ return $instance;
104
+
105
+ }
106
+
107
+ /**
108
+ * Widget controls
109
+ *
110
+ * @param $instance
111
+ */
112
+ function form( $instance ) {
113
+ ?>
114
+
115
+ <p>
116
+ <label
117
+ for="<?php echo $this->get_field_id( 'link' ); ?>"><?php _e( 'Link', 'zerif-lite' ); ?></label><br/>
118
+ <input type="text" name="<?php echo $this->get_field_name( 'link' ); ?>"
119
+ id="<?php echo $this->get_field_id( 'link' ); ?>"
120
+ value="<?php if ( ! empty( $instance['link'] ) ): echo $instance['link']; endif; ?>"
121
+ class="widefat">
122
+ </p>
123
+ <p>
124
+ <label
125
+ for="<?php echo $this->get_field_id( 'image_uri' ); ?>"><?php _e( 'Image', 'zerif-lite' ); ?></label><br/>
126
+
127
+ <?php
128
+ $image_in_customizer = '';
129
+ $display = 'none';
130
+ if ( ! empty( $instance['image_in_customizer'] ) && ! empty( $instance['image_uri'] ) ) {
131
+ $image_in_customizer = esc_url( $instance['image_in_customizer'] );
132
+ $display = 'inline-block';
133
+ } else {
134
+ if ( ! empty( $instance['image_uri'] ) ) {
135
+ $image_in_customizer = esc_url( $instance['image_uri'] );
136
+ $display = 'inline-block';
137
+ }
138
+ }
139
+ $zerif_image_in_customizer = $this->get_field_name( 'image_in_customizer' );
140
+ ?>
141
+ <input type="hidden" class="custom_media_display_in_customizer"
142
+ name="<?php if ( ! empty( $zerif_image_in_customizer ) ) {
143
+ echo $zerif_image_in_customizer;
144
+ } ?>"
145
+ value="<?php if ( ! empty( $instance['image_in_customizer'] ) ): echo $instance['image_in_customizer']; endif; ?>">
146
+ <img class="custom_media_image" src="<?php echo $image_in_customizer; ?>"
147
+ style="margin:0;padding:0;max-width:100px;float:left;display:<?php echo $display; ?>"
148
+ alt="<?php echo __( 'Uploaded image', 'zerif-lite' ); ?>"/><br/>
149
+
150
+ <input type="text" class="widefat custom_media_url"
151
+ name="<?php echo $this->get_field_name( 'image_uri' ); ?>"
152
+ id="<?php echo $this->get_field_id( 'image_uri' ); ?>"
153
+ value="<?php if ( ! empty( $instance['image_uri'] ) ): echo $instance['image_uri']; endif; ?>"
154
+ style="margin-top:5px;">
155
+
156
+ <input type="button" class="button button-primary custom_media_button" id="custom_media_button"
157
+ name="<?php echo $this->get_field_name( 'image_uri' ); ?>"
158
+ value="<?php _e( 'Upload Image', 'zerif-lite' ); ?>" style="margin-top:5px;">
159
+ </p>
160
+
161
+ <input class="custom_media_id" id="<?php echo $this->get_field_id( 'custom_media_id' ); ?>"
162
+ name="<?php echo $this->get_field_name( 'custom_media_id' ); ?>" type="hidden"
163
+ value="<?php if ( ! empty( $instance["custom_media_id"] ) ): echo $instance["custom_media_id"]; endif; ?>"/>
164
+ <?php
165
+
166
+ }
167
+
168
+ }
169
+ }
170
+
inc/zerif-lite/widgets/widget-focus.php ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Our Focus Widget
4
+ *
5
+ * @since 1.0.0
6
+ *
7
+ * @package themeisle-companion
8
+ */
9
+
10
+
11
+ /**
12
+ * Class zerif_ourfocus
13
+ */
14
+ if ( !class_exists( 'zerif_ourfocus' ) ) {
15
+
16
+ class zerif_ourfocus extends WP_Widget {
17
+
18
+ /**
19
+ * zerif_ourfocus constructor.
20
+ */
21
+ public function __construct() {
22
+ parent::__construct(
23
+ 'ctUp-ads-widget',
24
+ __( 'Zerif - Our focus widget', 'zerif-lite' ),
25
+ array(
26
+ 'customize_selective_refresh' => true,
27
+ )
28
+ );
29
+ add_action( 'admin_enqueue_scripts', array( $this, 'widget_scripts' ) );
30
+ }
31
+
32
+ /**
33
+ * Enqueue Widget Scripts
34
+ *
35
+ * @param $hook
36
+ */
37
+ function widget_scripts( $hook ) {
38
+ if ( $hook != 'widgets.php' ) {
39
+ return;
40
+ }
41
+ wp_enqueue_media();
42
+ wp_enqueue_script( 'zerif_widget_media_script', THEMEISLE_COMPANION_URL . 'assets/js/widget-media.js', false, '1.1', true );
43
+ }
44
+
45
+ /**
46
+ * Display Widget
47
+ *
48
+ * @param $args
49
+ * @param $instance
50
+ */
51
+ function widget( $args, $instance ) {
52
+
53
+ extract( $args );
54
+
55
+ echo $before_widget;
56
+
57
+ ?>
58
+
59
+ <div class="col-lg-3 col-sm-3 focus-box" data-scrollreveal="enter left after 0.15s over 1s">
60
+
61
+ <?php
62
+ if ( ! empty( $instance['image_uri'] ) && ( $instance['image_uri'] != 'Upload Image' ) ) {
63
+ if ( ! empty( $instance['link'] ) ) { ?>
64
+ <a href="<?php echo esc_url( $instance['link'] ); ?>" class="service-icon">
65
+ <?php
66
+ if ( ! empty( $instance['title'] ) ) { ?>
67
+ <span class="sr-only">
68
+ <?php _e( 'Go to', 'zerif-lite' ); ?>
69
+ <?php echo apply_filters( 'widget_title', $instance['title'] ); ?>
70
+ </span>
71
+ <?php
72
+ } ?>
73
+
74
+ <i class="pixeden"
75
+ style="background:url(<?php echo esc_url( $instance['image_uri'] ); ?>) no-repeat center;width:100%; height:100%;"></i>
76
+ </a>
77
+ <?php
78
+ } else { ?>
79
+ <div class="service-icon" tabindex="0">
80
+ <i class="pixeden"
81
+ style="background:url(<?php echo esc_url( $instance['image_uri'] ); ?>) no-repeat center;width:100%; height:100%;"></i>
82
+ <!-- FOCUS ICON-->
83
+ </div>
84
+ <?php
85
+ } ?>
86
+
87
+
88
+ <?php } elseif ( ! empty( $instance['custom_media_id'] ) ) {
89
+
90
+ $zerif_ourfocus_custom_media_id = wp_get_attachment_image_src( $instance["custom_media_id"] );
91
+ if ( ! empty( $zerif_ourfocus_custom_media_id ) && ! empty( $zerif_ourfocus_custom_media_id[0] ) ) {
92
+
93
+ if ( ! empty( $instance['link'] ) ) { ?>
94
+ <a href="<?php echo esc_url( $instance['link'] ); ?>" class="service-icon">
95
+ <?php
96
+ if ( ! empty( $instance['title'] ) ) { ?>
97
+ <span class="sr-only">
98
+ <?php _e( 'Go to', 'zerif-lite' ); ?>
99
+ <?php echo apply_filters( 'widget_title', $instance['title'] ); ?>
100
+ </span>
101
+ <?php
102
+ } ?>
103
+ <i class="pixeden"
104
+ style="background:url(<?php echo esc_url( $zerif_ourfocus_custom_media_id[0] ); ?>) no-repeat center;width:100%; height:100%;"></i>
105
+ </a>
106
+ <?php
107
+ } else { ?>
108
+ <div class="service-icon" tabindex="0">
109
+ <i class="pixeden"
110
+ style="background:url(<?php echo esc_url( $zerif_ourfocus_custom_media_id[0] ); ?>) no-repeat center;width:100%; height:100%;"></i>
111
+ <!-- FOCUS ICON-->
112
+ </div>
113
+ <?php
114
+ }
115
+ }
116
+
117
+ }
118
+ ?>
119
+
120
+ <h3 class="red-border-bottom"><?php if ( ! empty( $instance['title'] ) ): echo apply_filters( 'widget_title', $instance['title'] ); endif; ?></h3>
121
+ <!-- FOCUS HEADING -->
122
+
123
+ <?php
124
+ if ( ! empty( $instance['text'] ) ) {
125
+ echo '<p>';
126
+ echo htmlspecialchars_decode( apply_filters( 'widget_title', $instance['text'] ) );
127
+ echo '</p>';
128
+ }
129
+ ?>
130
+
131
+ </div>
132
+
133
+ <?php
134
+
135
+ echo $after_widget;
136
+
137
+ }
138
+
139
+ /**
140
+ * Update Widget
141
+ *
142
+ * @param $new_instance
143
+ * @param $old_instance
144
+ *
145
+ * @return mixed
146
+ */
147
+ function update( $new_instance, $old_instance ) {
148
+
149
+ $instance = $old_instance;
150
+ $instance['text'] = stripslashes( wp_filter_post_kses( $new_instance['text'] ) );
151
+ $instance['title'] = strip_tags( $new_instance['title'] );
152
+ $instance['link'] = strip_tags( $new_instance['link'] );
153
+ $instance['image_uri'] = strip_tags( $new_instance['image_uri'] );
154
+ $instance['custom_media_id'] = strip_tags( $new_instance['custom_media_id'] );
155
+ $instance['image_in_customizer'] = strip_tags( $new_instance['image_in_customizer'] );
156
+
157
+ return $instance;
158
+
159
+ }
160
+
161
+ /**
162
+ * Widget controls
163
+ *
164
+ * @param $instance
165
+ */
166
+ function form( $instance ) {
167
+ ?>
168
+
169
+ <p>
170
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'zerif-lite' ); ?></label><br/>
171
+ <input type="text" name="<?php echo $this->get_field_name( 'title' ); ?>"
172
+ id="<?php echo $this->get_field_id( 'title' ); ?>"
173
+ value="<?php if ( ! empty( $instance['title'] ) ): echo $instance['title']; endif; ?>"
174
+ class="widefat">
175
+ </p>
176
+ <p>
177
+ <label
178
+ for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Text', 'zerif-lite' ); ?></label><br/>
179
+ <textarea class="widefat" rows="8" cols="20" name="<?php echo $this->get_field_name( 'text' ); ?>"
180
+ id="<?php echo $this->get_field_id( 'text' ); ?>"><?php if ( ! empty( $instance['text'] ) ): echo htmlspecialchars_decode( $instance['text'] ); endif; ?></textarea>
181
+ </p>
182
+ <p>
183
+ <label
184
+ for="<?php echo $this->get_field_id( 'link' ); ?>"><?php _e( 'Link', 'zerif-lite' ); ?></label><br/>
185
+ <input type="text" name="<?php echo $this->get_field_name( 'link' ); ?>"
186
+ id="<?php echo $this->get_field_id( 'link' ); ?>"
187
+ value="<?php if ( ! empty( $instance['link'] ) ): echo esc_url( $instance['link'] ); endif; ?>"
188
+ class="widefat">
189
+ </p>
190
+ <p>
191
+ <label
192
+ for="<?php echo $this->get_field_id( 'image_uri' ); ?>"><?php _e( 'Image', 'zerif-lite' ); ?></label><br/>
193
+
194
+ <?php
195
+ $image_in_customizer = '';
196
+ $display = 'none';
197
+ if ( ! empty( $instance['image_in_customizer'] ) && ! empty( $instance['image_uri'] ) ) {
198
+ $image_in_customizer = esc_url( $instance['image_in_customizer'] );
199
+ $display = 'inline-block';
200
+ } else {
201
+ if ( ! empty( $instance['image_uri'] ) ) {
202
+ $image_in_customizer = esc_url( $instance['image_uri'] );
203
+ $display = 'inline-block';
204
+ }
205
+ }
206
+ $zerif_image_in_customizer = $this->get_field_name( 'image_in_customizer' );
207
+ ?>
208
+ <input type="hidden" class="custom_media_display_in_customizer"
209
+ name="<?php if ( ! empty( $zerif_image_in_customizer ) ) {
210
+ echo $zerif_image_in_customizer;
211
+ } ?>"
212
+ value="<?php if ( ! empty( $instance['image_in_customizer'] ) ): echo $instance['image_in_customizer']; endif; ?>">
213
+ <img class="custom_media_image" src="<?php echo $image_in_customizer; ?>"
214
+ style="margin:0;padding:0;max-width:100px;float:left;display:<?php echo $display; ?>"
215
+ alt="<?php echo __( 'Uploaded image', 'zerif-lite' ); ?>"/><br/>
216
+
217
+ <input type="text" class="widefat custom_media_url"
218
+ name="<?php echo $this->get_field_name( 'image_uri' ); ?>"
219
+ id="<?php echo $this->get_field_id( 'image_uri' ); ?>"
220
+ value="<?php if ( ! empty( $instance['image_uri'] ) ): echo $instance['image_uri']; endif; ?>"
221
+ style="margin-top:5px;">
222
+
223
+ <input type="button" class="button button-primary custom_media_button" id="custom_media_button"
224
+ name="<?php echo $this->get_field_name( 'image_uri' ); ?>"
225
+ value="<?php _e( 'Upload Image', 'zerif-lite' ); ?>" style="margin-top:5px;">
226
+ </p>
227
+
228
+ <input class="custom_media_id" id="<?php echo $this->get_field_id( 'custom_media_id' ); ?>"
229
+ name="<?php echo $this->get_field_name( 'custom_media_id' ); ?>" type="hidden"
230
+ value="<?php if ( ! empty( $instance["custom_media_id"] ) ): echo $instance["custom_media_id"]; endif; ?>"/>
231
+
232
+ <?php
233
+
234
+ }
235
+
236
+ }
237
+ }
inc/zerif-lite/widgets/widget-team.php ADDED
@@ -0,0 +1,387 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Testimonial Widget
4
+ *
5
+ * @since 1.0.0
6
+ *
7
+ * @package themeisle-companion
8
+ */
9
+
10
+
11
+ /**
12
+ * Class zerif_team_widget
13
+ */
14
+ if ( !class_exists( 'zerif_team_widget' ) ) {
15
+
16
+ class zerif_team_widget extends WP_Widget {
17
+
18
+ /**
19
+ * zerif_team_widget constructor.
20
+ */
21
+ public function __construct() {
22
+ parent::__construct(
23
+ 'zerif_team-widget',
24
+ __( 'Zerif - Team member widget', 'zerif-lite' ),
25
+ array(
26
+ 'customize_selective_refresh' => true,
27
+ )
28
+ );
29
+ add_action( 'admin_enqueue_scripts', array( $this, 'widget_scripts' ) );
30
+ }
31
+
32
+ /**
33
+ * Enqueue Widget Scripts
34
+ *
35
+ * @param $hook
36
+ */
37
+ function widget_scripts( $hook ) {
38
+ if ( $hook != 'widgets.php' ) {
39
+ return;
40
+ }
41
+ wp_enqueue_media();
42
+ wp_enqueue_script( 'zerif_widget_media_script', THEMEISLE_COMPANION_URL . 'assets/js/widget-media.js', false, '1.1', true );
43
+ }
44
+
45
+ /**
46
+ * Display Widget
47
+ *
48
+ * @param $args
49
+ * @param $instance
50
+ */
51
+ function widget( $args, $instance ) {
52
+
53
+ extract( $args );
54
+
55
+ echo $before_widget;
56
+
57
+ ?>
58
+
59
+ <div class="col-lg-3 col-sm-3 team-box">
60
+
61
+ <div class="team-member" tabindex="0">
62
+
63
+ <?php if ( ! empty( $instance['image_uri'] ) && ( $instance['image_uri'] != 'Upload Image' ) ) { ?>
64
+
65
+
66
+ <figure class="profile-pic">
67
+
68
+ <img src="<?php echo esc_url( $instance['image_uri'] ); ?>" alt=""/>
69
+
70
+ </figure>
71
+ <?php
72
+ } elseif ( ! empty( $instance['custom_media_id'] ) ) {
73
+
74
+ $zerif_team_custom_media_id = wp_get_attachment_image_src( $instance["custom_media_id"] );
75
+ $alt = get_post_meta( $instance['custom_media_id'], '_wp_attachment_image_alt', true );
76
+
77
+ if ( ! empty( $zerif_team_custom_media_id ) && ! empty( $zerif_team_custom_media_id[0] ) ) {
78
+ ?>
79
+
80
+ <figure class="profile-pic">
81
+
82
+ <img src="<?php echo esc_url( $zerif_team_custom_media_id[0] ); ?>"
83
+ alt="<?php echo $alt; ?>"/>
84
+
85
+ </figure>
86
+
87
+ <?php
88
+ }
89
+ }
90
+ ?>
91
+
92
+ <div class="member-details">
93
+
94
+ <?php if ( ! empty( $instance['name'] ) ): ?>
95
+
96
+ <h3 class="dark-text red-border-bottom"><?php echo apply_filters( 'widget_title', $instance['name'] ); ?></h3>
97
+
98
+ <?php endif; ?>
99
+
100
+ <?php if ( ! empty( $instance['position'] ) ): ?>
101
+
102
+ <div
103
+ class="position"><?php echo htmlspecialchars_decode( apply_filters( 'widget_title', $instance['position'] ) ); ?></div>
104
+
105
+ <?php endif; ?>
106
+
107
+ </div>
108
+
109
+ <div class="social-icons">
110
+
111
+ <ul>
112
+ <?php
113
+ $zerif_team_target = '_self';
114
+ if ( ! empty( $instance['open_new_window'] ) ):
115
+ $zerif_team_target = '_blank';
116
+ endif;
117
+ ?>
118
+
119
+ <?php
120
+ if ( ! empty( $instance['fb_link'] ) ): ?>
121
+ <li>
122
+ <a href="<?php echo apply_filters( 'widget_title', $instance['fb_link'] ); ?>"
123
+ target="<?php echo $zerif_team_target; ?>">
124
+ <?php
125
+ if ( ! empty( $instance['name'] ) ) { ?>
126
+ <span class="sr-only">
127
+ <?php _e( 'Facebook account of', 'zerif-lite' ); ?>
128
+ <?php echo apply_filters( 'widget_title', $instance['name'] ); ?>
129
+ </span>
130
+ <?php
131
+ } ?>
132
+ <i class="fa fa-facebook"></i>
133
+ </a>
134
+ </li>
135
+ <?php
136
+ endif;
137
+
138
+ if ( ! empty( $instance['tw_link'] ) ): ?>
139
+ <li>
140
+ <a href="<?php echo apply_filters( 'widget_title', $instance['tw_link'] ); ?>"
141
+ target="<?php echo $zerif_team_target; ?>">
142
+ <?php
143
+ if ( ! empty( $instance['name'] ) ) { ?>
144
+ <span class="sr-only">
145
+ <?php _e( 'Twitter account of', 'zerif-lite' ); ?>
146
+ <?php echo apply_filters( 'widget_title', $instance['name'] ); ?>
147
+ </span>
148
+ <?php
149
+ } ?>
150
+ <i class="fa fa-twitter"></i>
151
+ </a>
152
+ </li>
153
+ <?php
154
+ endif;
155
+
156
+ if ( ! empty( $instance['bh_link'] ) ): ?>
157
+ <li>
158
+ <a href="<?php echo apply_filters( 'widget_title', $instance['bh_link'] ); ?>"
159
+ target="<?php echo $zerif_team_target; ?>">
160
+ <?php
161
+ if ( ! empty( $instance['name'] ) ) { ?>
162
+ <span class="sr-only">
163
+ <?php _e( 'Behance account of', 'zerif-lite' ); ?>
164
+ <?php echo apply_filters( 'widget_title', $instance['name'] ); ?>
165
+ </span>
166
+ <?php
167
+ } ?>
168
+ <i class="fa fa-behance"></i>
169
+ </a>
170
+ </li>
171
+ <?php
172
+ endif;
173
+
174
+ if ( ! empty( $instance['db_link'] ) ): ?>
175
+ <li>
176
+ <a href="<?php echo apply_filters( 'widget_title', $instance['db_link'] ); ?>"
177
+ target="<?php echo $zerif_team_target; ?>">
178
+ <?php
179
+ if ( ! empty( $instance['name'] ) ) { ?>
180
+ <span class="sr-only">
181
+ <?php _e( 'Dribble account of', 'zerif-lite' ); ?>
182
+ <?php echo apply_filters( 'widget_title', $instance['name'] ); ?>
183
+ </span>
184
+ <?php
185
+ } ?>
186
+ <i class="fa fa-dribbble"></i>
187
+ </a>
188
+ </li>
189
+ <?php
190
+ endif;
191
+
192
+ if ( ! empty( $instance['ln_link'] ) ): ?>
193
+ <li>
194
+ <a href="<?php echo apply_filters( 'widget_title', $instance['ln_link'] ); ?>"
195
+ target="<?php echo $zerif_team_target; ?>">
196
+ <?php
197
+ if ( ! empty( $instance['name'] ) ) { ?>
198
+ <span class="sr-only">
199
+ <?php _e( 'Linkedin account of', 'zerif-lite' ); ?>
200
+ <?php echo apply_filters( 'widget_title', $instance['name'] ); ?>
201
+ </span>
202
+ <?php
203
+ } ?>
204
+ <i class="fa fa-linkedin"></i>
205
+ </a>
206
+ </li>
207
+ <?php
208
+ endif; ?>
209
+
210
+ </ul>
211
+
212
+ </div>
213
+
214
+ <?php if ( ! empty( $instance['description'] ) ): ?>
215
+ <div class="details">
216
+
217
+ <?php echo htmlspecialchars_decode( apply_filters( 'widget_title', $instance['description'] ) ); ?>
218
+
219
+ </div>
220
+ <?php endif; ?>
221
+
222
+ </div>
223
+
224
+ </div>
225
+
226
+ <?php
227
+
228
+ echo $after_widget;
229
+
230
+ }
231
+
232
+ /**
233
+ * Update Widget
234
+ *
235
+ * @param $new_instance
236
+ * @param $old_instance
237
+ *
238
+ * @return mixed
239
+ */
240
+ function update( $new_instance, $old_instance ) {
241
+
242
+ $instance = $old_instance;
243
+
244
+ $instance['name'] = strip_tags( $new_instance['name'] );
245
+ $instance['position'] = stripslashes( wp_filter_post_kses( $new_instance['position'] ) );
246
+ $instance['description'] = stripslashes( wp_filter_post_kses( $new_instance['description'] ) );
247
+ $instance['fb_link'] = strip_tags( $new_instance['fb_link'] );
248
+ $instance['tw_link'] = strip_tags( $new_instance['tw_link'] );
249
+ $instance['bh_link'] = strip_tags( $new_instance['bh_link'] );
250
+ $instance['db_link'] = strip_tags( $new_instance['db_link'] );
251
+ $instance['ln_link'] = strip_tags( $new_instance['ln_link'] );
252
+ $instance['image_uri'] = strip_tags( $new_instance['image_uri'] );
253
+ $instance['open_new_window'] = strip_tags( $new_instance['open_new_window'] );
254
+ $instance['custom_media_id'] = strip_tags( $new_instance['custom_media_id'] );
255
+ $instance['image_in_customizer'] = strip_tags( $new_instance['image_in_customizer'] );
256
+
257
+ return $instance;
258
+
259
+ }
260
+
261
+ /**
262
+ * Widget controls
263
+ *
264
+ * @param $instance
265
+ */
266
+ function form( $instance ) {
267
+
268
+ ?>
269
+
270
+ <p>
271
+ <label
272
+ for="<?php echo $this->get_field_id( 'name' ); ?>"><?php _e( 'Name', 'zerif-lite' ); ?></label><br/>
273
+ <input type="text" name="<?php echo $this->get_field_name( 'name' ); ?>"
274
+ id="<?php echo $this->get_field_id( 'name' ); ?>"
275
+ value="<?php if ( ! empty( $instance['name'] ) ): echo $instance['name']; endif; ?>"
276
+ class="widefat"/>
277
+ </p>
278
+ <p>
279
+ <label
280
+ for="<?php echo $this->get_field_id( 'position' ); ?>"><?php _e( 'Position', 'zerif-lite' ); ?></label><br/>
281
+ <textarea class="widefat" rows="8" cols="20" name="<?php echo $this->get_field_name( 'position' ); ?>"
282
+ id="<?php echo $this->get_field_id( 'position' ); ?>"><?php if ( ! empty( $instance['position'] ) ): echo htmlspecialchars_decode( $instance['position'] ); endif; ?></textarea>
283
+ </p>
284
+ <p>
285
+ <label
286
+ for="<?php echo $this->get_field_id( 'description' ); ?>"><?php _e( 'Description', 'zerif-lite' ); ?></label><br/>
287
+ <textarea class="widefat" rows="8" cols="20"
288
+ name="<?php echo $this->get_field_name( 'description' ); ?>"
289
+ id="<?php echo $this->get_field_id( 'description' ); ?>"><?php
290
+ if ( ! empty( $instance['description'] ) ): echo htmlspecialchars_decode( $instance['description'] ); endif;
291
+ ?></textarea>
292
+ </p>
293
+ <p>
294
+ <label
295
+ for="<?php echo $this->get_field_id( 'fb_link' ); ?>"><?php _e( 'Facebook link', 'zerif-lite' ); ?></label><br/>
296
+ <input type="text" name="<?php echo $this->get_field_name( 'fb_link' ); ?>"
297
+ id="<?php echo $this->get_field_id( 'fb_link' ); ?>"
298
+ value="<?php if ( ! empty( $instance['fb_link'] ) ): echo $instance['fb_link']; endif; ?>"
299
+ class="widefat">
300
+
301
+ </p>
302
+ <p>
303
+ <label
304
+ for="<?php echo $this->get_field_id( 'tw_link' ); ?>"><?php _e( 'Twitter link', 'zerif-lite' ); ?></label><br/>
305
+ <input type="text" name="<?php echo $this->get_field_name( 'tw_link' ); ?>"
306
+ id="<?php echo $this->get_field_id( 'tw_link' ); ?>"
307
+ value="<?php if ( ! empty( $instance['tw_link'] ) ): echo $instance['tw_link']; endif; ?>"
308
+ class="widefat">
309
+ </p>
310
+ <p>
311
+ <label
312
+ for="<?php echo $this->get_field_id( 'bh_link' ); ?>"><?php _e( 'Behance link', 'zerif-lite' ); ?></label><br/>
313
+ <input type="text" name="<?php echo $this->get_field_name( 'bh_link' ); ?>"
314
+ id="<?php echo $this->get_field_id( 'bh_link' ); ?>"
315
+ value="<?php if ( ! empty( $instance['bh_link'] ) ): echo $instance['bh_link']; endif; ?>"
316
+ class="widefat">
317
+
318
+ </p>
319
+ <p>
320
+ <label
321
+ for="<?php echo $this->get_field_id( 'db_link' ); ?>"><?php _e( 'Dribble link', 'zerif-lite' ); ?></label><br/>
322
+ <input type="text" name="<?php echo $this->get_field_name( 'db_link' ); ?>"
323
+ id="<?php echo $this->get_field_id( 'db_link' ); ?>"
324
+ value="<?php if ( ! empty( $instance['db_link'] ) ): echo $instance['db_link']; endif; ?>"
325
+ class="widefat">
326
+ </p>
327
+ <p>
328
+ <label
329
+ for="<?php echo $this->get_field_id( 'ln_link' ); ?>"><?php _e( 'Linkedin link', 'zerif-lite' ); ?></label><br/>
330
+ <input type="text" name="<?php echo $this->get_field_name( 'ln_link' ); ?>"
331
+ id="<?php echo $this->get_field_id( 'ln_link' ); ?>"
332
+ value="<?php if ( ! empty( $instance['ln_link'] ) ): echo $instance['ln_link']; endif; ?>"
333
+ class="widefat">
334
+ </p>
335
+ <p>
336
+ <input type="checkbox" name="<?php echo $this->get_field_name( 'open_new_window' ); ?>"
337
+ id="<?php echo $this->get_field_id( 'open_new_window' ); ?>" <?php if ( ! empty( $instance['open_new_window'] ) ): checked( (bool) $instance['open_new_window'], true ); endif; ?> ><?php _e( 'Open links in new window?', 'zerif-lite' ); ?>
338
+ <br>
339
+ </p>
340
+ <p>
341
+ <label
342
+ for="<?php echo $this->get_field_id( 'image_uri' ); ?>"><?php _e( 'Image', 'zerif-lite' ); ?></label><br/>
343
+
344
+ <?php
345
+ $image_in_customizer = '';
346
+ $display = 'none';
347
+ if ( ! empty( $instance['image_in_customizer'] ) && ! empty( $instance['image_uri'] ) ) {
348
+ $image_in_customizer = esc_url( $instance['image_in_customizer'] );
349
+ $display = 'inline-block';
350
+ } else {
351
+ if ( ! empty( $instance['image_uri'] ) ) {
352
+ $image_in_customizer = esc_url( $instance['image_uri'] );
353
+ $display = 'inline-block';
354
+ }
355
+ }
356
+ $zerif_image_in_customizer = $this->get_field_name( 'image_in_customizer' );
357
+ ?>
358
+ <input type="hidden" class="custom_media_display_in_customizer"
359
+ name="<?php if ( ! empty( $zerif_image_in_customizer ) ) {
360
+ echo $zerif_image_in_customizer;
361
+ } ?>"
362
+ value="<?php if ( ! empty( $instance['image_in_customizer'] ) ): echo $instance['image_in_customizer']; endif; ?>">
363
+ <img class="custom_media_image" src="<?php echo $image_in_customizer; ?>"
364
+ style="margin:0;padding:0;max-width:100px;float:left;display:<?php echo $display; ?>"
365
+ alt="<?php echo __( 'Uploaded image', 'zerif-lite' ); ?>"/><br/>
366
+
367
+ <input type="text" class="widefat custom_media_url"
368
+ name="<?php echo $this->get_field_name( 'image_uri' ); ?>"
369
+ id="<?php echo $this->get_field_id( 'image_uri' ); ?>"
370
+ value="<?php if ( ! empty( $instance['image_uri'] ) ): echo $instance['image_uri']; endif; ?>"
371
+ style="margin-top:5px;">
372
+
373
+ <input type="button" class="button button-primary custom_media_button" id="custom_media_button"
374
+ name="<?php echo $this->get_field_name( 'image_uri' ); ?>"
375
+ value="<?php _e( 'Upload Image', 'zerif-lite' ); ?>" style="margin-top:5px;">
376
+ </p>
377
+
378
+ <input class="custom_media_id" id="<?php echo $this->get_field_id( 'custom_media_id' ); ?>"
379
+ name="<?php echo $this->get_field_name( 'custom_media_id' ); ?>" type="hidden"
380
+ value="<?php if ( ! empty( $instance["custom_media_id"] ) ): echo $instance["custom_media_id"]; endif; ?>"/>
381
+
382
+ <?php
383
+
384
+ }
385
+
386
+ }
387
+ }
inc/zerif-lite/widgets/widget-testimonial.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Testimonial Widget
4
+ *
5
+ * @since 1.0.0
6
+ *
7
+ * @package themeisle-companion
8
+ */
9
+
10
+
11
+ /**
12
+ * Class zerif_testimonial_widget
13
+ */
14
+ if ( !class_exists( 'zerif_testimonial_widget' ) ) {
15
+
16
+ class zerif_testimonial_widget extends WP_Widget {
17
+
18
+ /**
19
+ * zerif_testimonial_widget constructor.
20
+ */
21
+ public function __construct() {
22
+ parent::__construct(
23
+ 'zerif_testim-widget',
24
+ __( 'Zerif - Testimonial widget', 'zerif-lite' ),
25
+ array(
26
+ 'customize_selective_refresh' => true,
27
+ )
28
+ );
29
+ add_action( 'admin_enqueue_scripts', array( $this, 'widget_scripts' ) );
30
+ }
31
+
32
+ /**
33
+ * Enqueue Widget Scripts
34
+ *
35
+ * @param $hook
36
+ */
37
+ function widget_scripts( $hook ) {
38
+ if ( $hook != 'widgets.php' ) {
39
+ return;
40
+ }
41
+ wp_enqueue_media();
42
+ wp_enqueue_script( 'zerif_widget_media_script', THEMEISLE_COMPANION_URL . 'assets/js/widget-media.js', false, '1.1', true );
43
+ }
44
+
45
+ /**
46
+ * Display Widget
47
+ *
48
+ * @param $args
49
+ * @param $instance
50
+ */
51
+ function widget( $args, $instance ) {
52
+
53
+ extract( $args );
54
+
55
+ $zerif_accessibility = get_theme_mod( 'zerif_accessibility' );
56
+ // open link in a new tab when checkbox "accessibility" is not ticked
57
+ $attribut_new_tab = ( isset( $zerif_accessibility ) && ( $zerif_accessibility != 1 ) ? ' target="_blank"' : '' );
58
+
59
+ echo $before_widget;
60
+
61
+ ?>
62
+
63
+
64
+ <!-- MESSAGE OF THE CLIENT -->
65
+
66
+ <?php if ( ! empty( $instance['text'] ) ): ?>
67
+ <div class="message">
68
+ <?php echo htmlspecialchars_decode( apply_filters( 'widget_title', $instance['text'] ) ); ?>
69
+ </div>
70
+ <?php endif; ?>
71
+
72
+ <!-- CLIENT INFORMATION -->
73
+
74
+ <div class="client">
75
+
76
+ <div class="quote red-text">
77
+
78
+ <i class="fa fa-quote-left"></i>
79
+
80
+ </div>
81
+
82
+ <div class="client-info">
83
+
84
+ <a <?php echo $attribut_new_tab; ?>
85
+ class="client-name" <?php if ( ! empty( $instance['link'] ) ): echo 'href="' . esc_url( $instance['link'] ) . '"'; endif; ?>><?php if ( ! empty( $instance['title'] ) ): echo apply_filters( 'widget_title', $instance['title'] ); endif; ?></a>
86
+
87
+
88
+ <?php if ( ! empty( $instance['details'] ) ): ?>
89
+ <div class="client-company">
90
+
91
+ <?php echo apply_filters( 'widget_title', $instance['details'] ); ?>
92
+
93
+ </div>
94
+ <?php endif; ?>
95
+
96
+ </div>
97
+
98
+ <?php
99
+
100
+ if ( ! empty( $instance['image_uri'] ) && ( $instance['image_uri'] != 'Upload Image' ) ) {
101
+
102
+ echo '<div class="client-image hidden-xs">';
103
+
104
+ echo '<img src="' . esc_url( $instance['image_uri'] ) . '" alt="" />';
105
+
106
+ echo '</div>';
107
+
108
+ } elseif ( ! empty( $instance['custom_media_id'] ) ) {
109
+
110
+ $zerif_testimonials_custom_media_id = wp_get_attachment_image_src( $instance["custom_media_id"] );
111
+ $alt = get_post_meta( $instance['custom_media_id'], '_wp_attachment_image_alt', true );
112
+
113
+ if ( ! empty( $zerif_testimonials_custom_media_id ) && ! empty( $zerif_testimonials_custom_media_id[0] ) ) {
114
+
115
+ echo '<div class="client-image hidden-xs">';
116
+
117
+ echo '<img src="' . esc_url( $zerif_testimonials_custom_media_id[0] ) . '" alt="' . $alt . '" />';
118
+
119
+ echo '</div>';
120
+
121
+ }
122
+ }
123
+
124
+ ?>
125
+
126
+ </div>
127
+ <!-- / END CLIENT INFORMATION-->
128
+
129
+
130
+ <?php
131
+
132
+ echo $after_widget;
133
+
134
+ }
135
+
136
+ /**
137
+ * Update Widget
138
+ *
139
+ * @param $new_instance
140
+ * @param $old_instance
141
+ *
142
+ * @return mixed
143
+ */
144
+ function update( $new_instance, $old_instance ) {
145
+
146
+ $instance = $old_instance;
147
+ $instance['text'] = stripslashes( wp_filter_post_kses( $new_instance['text'] ) );
148
+ $instance['title'] = strip_tags( $new_instance['title'] );
149
+ $instance['details'] = strip_tags( $new_instance['details'] );
150
+ $instance['image_uri'] = strip_tags( $new_instance['image_uri'] );
151
+ $instance['link'] = strip_tags( $new_instance['link'] );
152
+ $instance['custom_media_id'] = strip_tags( $new_instance['custom_media_id'] );
153
+ $instance['image_in_customizer'] = strip_tags( $new_instance['image_in_customizer'] );
154
+
155
+ return $instance;
156
+
157
+ }
158
+
159
+ /**
160
+ * Widget controls
161
+ *
162
+ * @param $instance
163
+ */
164
+ function form( $instance ) {
165
+ ?>
166
+
167
+ <p>
168
+ <label
169
+ for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Author', 'zerif-lite' ); ?></label><br/>
170
+ <input type="text" name="<?php echo $this->get_field_name( 'title' ); ?>"
171
+ id="<?php echo $this->get_field_id( 'title' ); ?>"
172
+ value="<?php if ( ! empty( $instance['title'] ) ): echo $instance['title']; endif; ?>"
173
+ class="widefat">
174
+ </p>
175
+ <p>
176
+ <label
177
+ for="<?php echo $this->get_field_id( 'link' ); ?>"><?php _e( 'Author link', 'zerif-lite' ); ?></label><br/>
178
+ <input type="text" name="<?php echo $this->get_field_name( 'link' ); ?>"
179
+ id="<?php echo $this->get_field_id( 'link' ); ?>"
180
+ value="<?php if ( ! empty( $instance['link'] ) ): echo esc_url( $instance['link'] ); endif; ?>"
181
+ class="widefat">
182
+ </p>
183
+ <p>
184
+ <label
185
+ for="<?php echo $this->get_field_id( 'details' ); ?>"><?php _e( 'Author details', 'zerif-lite' ); ?></label><br/>
186
+ <input type="text" name="<?php echo $this->get_field_name( 'details' ); ?>"
187
+ id="<?php echo $this->get_field_id( 'details' ); ?>"
188
+ value="<?php if ( ! empty( $instance['details'] ) ): echo $instance['details']; endif; ?>"
189
+ class="widefat">
190
+ </p>
191
+ <p>
192
+ <label
193
+ for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Text', 'zerif-lite' ); ?></label><br/>
194
+ <textarea class="widefat" rows="8" cols="20" name="<?php echo $this->get_field_name( 'text' ); ?>"
195
+ id="<?php echo $this->get_field_id( 'text' ); ?>"><?php if ( ! empty( $instance['text'] ) ): echo htmlspecialchars_decode( $instance['text'] ); endif; ?></textarea>
196
+ </p>
197
+ <p>
198
+ <label
199
+ for="<?php echo $this->get_field_id( 'image_uri' ); ?>"><?php _e( 'Image', 'zerif-lite' ); ?></label><br/>
200
+
201
+ <?php
202
+ $image_in_customizer = '';
203
+ $display = 'none';
204
+ if ( ! empty( $instance['image_in_customizer'] ) && ! empty( $instance['image_uri'] ) ) {
205
+ $image_in_customizer = esc_url( $instance['image_in_customizer'] );
206
+ $display = 'inline-block';
207
+ } else {
208
+ if ( ! empty( $instance['image_uri'] ) ) {
209
+ $image_in_customizer = esc_url( $instance['image_uri'] );
210
+ $display = 'inline-block';
211
+ }
212
+ }
213
+ $zerif_image_in_customizer = $this->get_field_name( 'image_in_customizer' );
214
+ ?>
215
+ <input type="hidden" class="custom_media_display_in_customizer"
216
+ name="<?php if ( ! empty( $zerif_image_in_customizer ) ) {
217
+ echo $zerif_image_in_customizer;
218
+ } ?>"
219
+ value="<?php if ( ! empty( $instance['image_in_customizer'] ) ): echo $instance['image_in_customizer']; endif; ?>">
220
+ <img class="custom_media_image" src="<?php echo $image_in_customizer; ?>"
221
+ style="margin:0;padding:0;max-width:100px;float:left;display:<?php echo $display; ?>"
222
+ alt="<?php echo __( 'Uploaded image', 'zerif-lite' ); ?>"/><br/>
223
+
224
+ <input type="text" class="widefat custom_media_url"
225
+ name="<?php echo $this->get_field_name( 'image_uri' ); ?>"
226
+ id="<?php echo $this->get_field_id( 'image_uri' ); ?>"
227
+ value="<?php if ( ! empty( $instance['image_uri'] ) ): echo $instance['image_uri']; endif; ?>"
228
+ style="margin-top:5px;">
229
+
230
+ <input type="button" class="button button-primary custom_media_button" id="custom_media_button"
231
+ name="<?php echo $this->get_field_name( 'image_uri' ); ?>"
232
+ value="<?php _e( 'Upload Image', 'zerif-lite' ); ?>" style="margin-top:5px;">
233
+ </p>
234
+
235
+ <input class="custom_media_id" id="<?php echo $this->get_field_id( 'custom_media_id' ); ?>"
236
+ name="<?php echo $this->get_field_name( 'custom_media_id' ); ?>" type="hidden"
237
+ value="<?php if ( ! empty( $instance["custom_media_id"] ) ): echo $instance["custom_media_id"]; endif; ?>"/>
238
+
239
+ <?php
240
+
241
+ }
242
+
243
+ }
244
+ }
inc/zerif-lite/zerif-lite-functions.php ADDED
@@ -0,0 +1,410 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Companion code for Zerif-Lite
4
+ *
5
+ * @author Themeisle
6
+ * @package themeisle-companion
7
+ */
8
+
9
+
10
+ /**
11
+ * Populate Zerif frontpage widgets areas with default widgets
12
+ */
13
+ function themeisle_populate_with_default_widgets() {
14
+
15
+ $zerif_lite_sidebars = array( 'sidebar-ourfocus' => 'sidebar-ourfocus',
16
+ 'sidebar-testimonials' => 'sidebar-testimonials',
17
+ 'sidebar-ourteam' => 'sidebar-ourteam',
18
+ 'sidebar-aboutus' => 'sidebar-aboutus'
19
+ );
20
+
21
+ $active_widgets = get_option( 'sidebars_widgets' );
22
+
23
+ /**
24
+ * Populate the Our Focus sidebar
25
+ */
26
+ if ( empty ( $active_widgets[ $zerif_lite_sidebars['sidebar-ourfocus'] ] ) ) {
27
+
28
+ $zerif_lite_counter = 1;
29
+
30
+ /* our focus widget #1 */
31
+
32
+ $active_widgets['sidebar-ourfocus'][0] = 'ctup-ads-widget-' . $zerif_lite_counter;
33
+
34
+ if ( file_exists( get_stylesheet_directory() . '/images/parallax.png' ) ) {
35
+ $ourfocus_content[ $zerif_lite_counter ] = array(
36
+ 'title' => 'PARALLAX EFFECT',
37
+ 'text' => 'Create memorable pages with smooth parallax effects that everyone loves. Also, use our lightweight content slider offering you smooth and great-looking animations.',
38
+ 'link' => '#',
39
+ 'image_uri' => get_stylesheet_directory_uri() . "/images/parallax.png"
40
+ );
41
+ } else {
42
+ $ourfocus_content[ $zerif_lite_counter ] = array(
43
+ 'title' => 'PARALLAX EFFECT',
44
+ 'text' => 'Create memorable pages with smooth parallax effects that everyone loves. Also, use our lightweight content slider offering you smooth and great-looking animations.',
45
+ 'link' => '#',
46
+ 'image_uri' => get_template_directory_uri() . "/images/parallax.png"
47
+ );
48
+ }
49
+
50
+ update_option( 'widget_ctup-ads-widget', $ourfocus_content );
51
+
52
+ $zerif_lite_counter ++;
53
+
54
+ /* our focus widget #2 */
55
+
56
+ $active_widgets['sidebar-ourfocus'][] = 'ctup-ads-widget-' . $zerif_lite_counter;
57
+
58
+ if ( file_exists( get_stylesheet_directory() . '/images/woo.png' ) ) {
59
+ $ourfocus_content[ $zerif_lite_counter ] = array(
60
+ 'title' => 'WOOCOMMERCE',
61
+ 'text' => 'Build a front page for your WooCommerce store in a matter of minutes. The neat and clean presentation will help your sales and make your store accessible to everyone.',
62
+ 'link' => '#',
63
+ 'image_uri' => get_stylesheet_directory_uri() . "/images/woo.png"
64
+ );
65
+ } else {
66
+ $ourfocus_content[ $zerif_lite_counter ] = array(
67
+ 'title' => 'WOOCOMMERCE',
68
+ 'text' => 'Build a front page for your WooCommerce store in a matter of minutes. The neat and clean presentation will help your sales and make your store accessible to everyone.',
69
+ 'link' => '#',
70
+ 'image_uri' => get_template_directory_uri() . "/images/woo.png"
71
+ );
72
+ }
73
+
74
+ update_option( 'widget_ctup-ads-widget', $ourfocus_content );
75
+
76
+ $zerif_lite_counter ++;
77
+
78
+ /* our focus widget #3 */
79
+
80
+ $active_widgets['sidebar-ourfocus'][] = 'ctup-ads-widget-' . $zerif_lite_counter;
81
+
82
+ if ( file_exists( get_stylesheet_directory() . '/images/ccc.png' ) ) {
83
+ $ourfocus_content[ $zerif_lite_counter ] = array(
84
+ 'title' => 'CUSTOM CONTENT BLOCKS',
85
+ 'text' => 'Showcase your team, products, clients, about info, testimonials, latest posts from the blog, contact form, additional calls to action. Everything translation ready.',
86
+ 'link' => '#',
87
+ 'image_uri' => get_stylesheet_directory_uri() . "/images/ccc.png"
88
+ );
89
+ } else {
90
+ $ourfocus_content[ $zerif_lite_counter ] = array(
91
+ 'title' => 'CUSTOM CONTENT BLOCKS',
92
+ 'text' => 'Showcase your team, products, clients, about info, testimonials, latest posts from the blog, contact form, additional calls to action. Everything translation ready.',
93
+ 'link' => '#',
94
+ 'image_uri' => get_template_directory_uri() . "/images/ccc.png"
95
+ );
96
+ }
97
+
98
+ update_option( 'widget_ctup-ads-widget', $ourfocus_content );
99
+
100
+ $zerif_lite_counter ++;
101
+
102
+ /* our focus widget #4 */
103
+
104
+ $active_widgets['sidebar-ourfocus'][] = 'ctup-ads-widget-' . $zerif_lite_counter;
105
+
106
+ if ( file_exists( get_stylesheet_directory() . '/images/ti-logo.png' ) ) {
107
+ $ourfocus_content[ $zerif_lite_counter ] = array(
108
+ 'title' => 'GO PRO FOR MORE FEATURES',
109
+ 'text' => 'Get new content blocks: pricing table, Google Maps, and more. Change the sections order, display each block exactly where you need it, customize the blocks with whatever colors you wish.',
110
+ 'link' => '#',
111
+ 'image_uri' => get_stylesheet_directory_uri() . "/images/ti-logo.png"
112
+ );
113
+ } else {
114
+ $ourfocus_content[ $zerif_lite_counter ] = array(
115
+ 'title' => 'GO PRO FOR MORE FEATURES',
116
+ 'text' => 'Get new content blocks: pricing table, Google Maps, and more. Change the sections order, display each block exactly where you need it, customize the blocks with whatever colors you wish.',
117
+ 'link' => '#',
118
+ 'image_uri' => get_template_directory_uri() . "/images/ti-logo.png"
119
+ );
120
+ }
121
+
122
+ update_option( 'widget_ctup-ads-widget', $ourfocus_content );
123
+
124
+ $zerif_lite_counter ++;
125
+
126
+ update_option( 'sidebars_widgets', $active_widgets );
127
+
128
+ }
129
+
130
+ /**
131
+ * Populate the Testimonials sidebar
132
+ */
133
+ if ( empty ( $active_widgets[ $zerif_lite_sidebars['sidebar-testimonials'] ] ) ) {
134
+
135
+ $zerif_lite_counter = 1;
136
+
137
+ /* testimonial widget #1 */
138
+
139
+ $active_widgets['sidebar-testimonials'][0] = 'zerif_testim-widget-' . $zerif_lite_counter;
140
+
141
+ if ( file_exists( get_stylesheet_directory() . '/images/testimonial1.jpg' ) ) {
142
+ $testimonial_content[ $zerif_lite_counter ] = array(
143
+ 'title' => 'Dana Lorem',
144
+ 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
145
+ 'image_uri' => get_stylesheet_directory_uri() . "/images/testimonial1.jpg"
146
+ );
147
+ } else {
148
+ $testimonial_content[ $zerif_lite_counter ] = array(
149
+ 'title' => 'Dana Lorem',
150
+ 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
151
+ 'image_uri' => get_template_directory_uri() . "/images/testimonial1.jpg"
152
+ );
153
+ }
154
+
155
+ update_option( 'widget_zerif_testim-widget', $testimonial_content );
156
+
157
+ $zerif_lite_counter ++;
158
+
159
+ /* testimonial widget #2 */
160
+
161
+ $active_widgets['sidebar-testimonials'][] = 'zerif_testim-widget-' . $zerif_lite_counter;
162
+
163
+ if ( file_exists( get_stylesheet_directory() . '/images/testimonial2.jpg' ) ) {
164
+ $testimonial_content[ $zerif_lite_counter ] = array(
165
+ 'title' => 'Linda Guthrie',
166
+ 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
167
+ 'image_uri' => get_stylesheet_directory_uri() . "/images/testimonial2.jpg"
168
+ );
169
+ } else {
170
+ $testimonial_content[ $zerif_lite_counter ] = array(
171
+ 'title' => 'Linda Guthrie',
172
+ 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
173
+ 'image_uri' => get_template_directory_uri() . "/images/testimonial2.jpg"
174
+ );
175
+ }
176
+
177
+ update_option( 'widget_zerif_testim-widget', $testimonial_content );
178
+
179
+ $zerif_lite_counter ++;
180
+
181
+ /* testimonial widget #3 */
182
+
183
+ $active_widgets['sidebar-testimonials'][] = 'zerif_testim-widget-' . $zerif_lite_counter;
184
+
185
+ if ( file_exists( get_stylesheet_directory() . '/images/testimonial3.jpg' ) ) {
186
+ $testimonial_content[ $zerif_lite_counter ] = array(
187
+ 'title' => 'Cynthia Henry',
188
+ 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
189
+ 'image_uri' => get_stylesheet_directory_uri() . "/images/testimonial3.jpg"
190
+ );
191
+ } else {
192
+ $testimonial_content[ $zerif_lite_counter ] = array(
193
+ 'title' => 'Cynthia Henry',
194
+ 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
195
+ 'image_uri' => get_template_directory_uri() . "/images/testimonial3.jpg"
196
+ );
197
+ }
198
+
199
+ update_option( 'widget_zerif_testim-widget', $testimonial_content );
200
+
201
+ $zerif_lite_counter ++;
202
+
203
+ update_option( 'sidebars_widgets', $active_widgets );
204
+ }
205
+
206
+ /**
207
+ * Populate the Our team sidebar
208
+ */
209
+ if ( empty ( $active_widgets[ $zerif_lite_sidebars['sidebar-ourteam'] ] ) ) {
210
+
211
+ $zerif_lite_counter = 1;
212
+
213
+ /* our team widget #1 */
214
+
215
+ $active_widgets['sidebar-ourteam'][0] = 'zerif_team-widget-' . $zerif_lite_counter;
216
+
217
+ $ourteam_content[ $zerif_lite_counter ] = array(
218
+ 'name' => 'ASHLEY SIMMONS',
219
+ 'position' => 'Project Manager',
220
+ 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dapibus, eros at accumsan auctor, felis eros condimentum quam, non porttitor est urna vel neque',
221
+ 'fb_link' => '#',
222
+ 'tw_link' => '#',
223
+ 'bh_link' => '#',
224
+ 'db_link' => '#',
225
+ 'ln_link' => '#',
226
+ 'image_uri' => get_template_directory_uri() . "/images/team1.png"
227
+ );
228
+
229
+ update_option( 'widget_zerif_team-widget', $ourteam_content );
230
+
231
+ $zerif_lite_counter ++;
232
+
233
+ /* our team widget #2 */
234
+
235
+ $active_widgets['sidebar-ourteam'][] = 'zerif_team-widget-' . $zerif_lite_counter;
236
+
237
+ $ourteam_content[ $zerif_lite_counter ] = array(
238
+ 'name' => 'TIMOTHY SPRAY',
239
+ 'position' => 'Art Director',
240
+ 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dapibus, eros at accumsan auctor, felis eros condimentum quam, non porttitor est urna vel neque',
241
+ 'fb_link' => '#',
242
+ 'tw_link' => '#',
243
+ 'bh_link' => '#',
244
+ 'db_link' => '#',
245
+ 'ln_link' => '#',
246
+ 'image_uri' => get_template_directory_uri() . "/images/team2.png"
247
+ );
248
+
249
+ update_option( 'widget_zerif_team-widget', $ourteam_content );
250
+
251
+ $zerif_lite_counter ++;
252
+
253
+ /* our team widget #3 */
254
+
255
+ $active_widgets['sidebar-ourteam'][] = 'zerif_team-widget-' . $zerif_lite_counter;
256
+
257
+ $ourteam_content[ $zerif_lite_counter ] = array(
258
+ 'name' => 'TONYA GARCIA',
259
+ 'position' => 'Account Manager',
260
+ 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dapibus, eros at accumsan auctor, felis eros condimentum quam, non porttitor est urna vel neque',
261
+ 'fb_link' => '#',
262
+ 'tw_link' => '#',
263
+ 'bh_link' => '#',
264
+ 'db_link' => '#',
265
+ 'ln_link' => '#',
266
+ 'image_uri' => get_template_directory_uri() . "/images/team3.png"
267
+ );
268
+
269
+ update_option( 'widget_zerif_team-widget', $ourteam_content );
270
+
271
+ $zerif_lite_counter ++;
272
+
273
+ /* our team widget #4 */
274
+
275
+ $active_widgets['sidebar-ourteam'][] = 'zerif_team-widget-' . $zerif_lite_counter;
276
+
277
+ $ourteam_content[ $zerif_lite_counter ] = array(
278
+ 'name' => 'JASON LANE',
279
+ 'position' => 'Business Development',
280
+ 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dapibus, eros at accumsan auctor, felis eros condimentum quam, non porttitor est urna vel neque',
281
+ 'fb_link' => '#',
282
+ 'tw_link' => '#',
283
+ 'bh_link' => '#',
284
+ 'db_link' => '#',
285
+ 'ln_link' => '#',
286
+ 'image_uri' => get_template_directory_uri() . "/images/team4.png"
287
+ );
288
+
289
+ update_option( 'widget_zerif_team-widget', $ourteam_content );
290
+
291
+ $zerif_lite_counter ++;
292
+
293
+ update_option( 'sidebars_widgets', $active_widgets );
294
+ }
295
+
296
+ /**
297
+ * Populate the Aboutus sidebar with Client widgets
298
+ */
299
+ if ( empty ( $active_widgets[ $zerif_lite_sidebars['sidebar-aboutus'] ] ) ) {
300
+
301
+ $zerif_lite_counter = 1;
302
+
303
+ /* client widget #1 */
304
+
305
+ $active_widgets['sidebar-aboutus'][0] = 'zerif_clients-widget-' . $zerif_lite_counter;
306
+
307
+ $client_content[ $zerif_lite_counter ] = array(
308
+ 'link' => '#',
309
+ 'image_uri' => get_template_directory_uri() . "/images/clients1.png"
310
+ );
311
+
312
+ update_option( 'widget_zerif_clients-widget', $client_content );
313
+
314
+ $zerif_lite_counter ++;
315
+
316
+ /* client widget #2 */
317
+
318
+ $active_widgets['sidebar-aboutus'][] = 'zerif_clients-widget-' . $zerif_lite_counter;
319
+
320
+ $client_content[ $zerif_lite_counter ] = array(
321
+ 'link' => '#',
322
+ 'image_uri' => get_template_directory_uri() . "/images/clients2.png"
323
+ );
324
+
325
+ update_option( 'widget_zerif_clients-widget', $client_content );
326
+
327
+ $zerif_lite_counter ++;
328
+
329
+ update_option( 'sidebars_widgets', $active_widgets );
330
+
331
+ /* client widget #3 */
332
+
333
+ $active_widgets['sidebar-aboutus'][] = 'zerif_clients-widget-' . $zerif_lite_counter;
334
+
335
+ $client_content[ $zerif_lite_counter ] = array(
336
+ 'link' => '#',
337
+ 'image_uri' => get_template_directory_uri() . "/images/clients3.png"
338
+ );
339
+
340
+ update_option( 'widget_zerif_clients-widget', $client_content );
341
+
342
+ $zerif_lite_counter ++;
343
+
344
+ update_option( 'sidebars_widgets', $active_widgets );
345
+
346
+ /* client widget #4 */
347
+
348
+ $active_widgets['sidebar-aboutus'][] = 'zerif_clients-widget-' . $zerif_lite_counter;
349
+
350
+ $client_content[ $zerif_lite_counter ] = array(
351
+ 'link' => '#',
352
+ 'image_uri' => get_template_directory_uri() . "/images/clients4.png"
353
+ );
354
+
355
+ update_option( 'widget_zerif_clients-widget', $client_content );
356
+
357
+ $zerif_lite_counter ++;
358
+
359
+ update_option( 'sidebars_widgets', $active_widgets );
360
+
361
+ /* client widget #5 */
362
+
363
+ $active_widgets['sidebar-aboutus'][] = 'zerif_clients-widget-' . $zerif_lite_counter;
364
+
365
+ $client_content[ $zerif_lite_counter ] = array(
366
+ 'link' => '#',
367
+ 'image_uri' => get_template_directory_uri() . "/images/clients5.png"
368
+ );
369
+
370
+ update_option( 'widget_zerif_clients-widget', $client_content );
371
+
372
+ $zerif_lite_counter ++;
373
+
374
+ update_option( 'sidebars_widgets', $active_widgets );
375
+
376
+ }
377
+
378
+ update_option( 'themeisle_companion_flag', 'installed' );
379
+
380
+ }
381
+
382
+ /**
383
+ * Register Zerif Widgets
384
+ */
385
+ function themeisle_register_widgets() {
386
+
387
+ register_widget( 'zerif_ourfocus' );
388
+ register_widget( 'zerif_testimonial_widget' );
389
+ register_widget( 'zerif_clients_widget' );
390
+ register_widget( 'zerif_team_widget' );
391
+
392
+ $theme = wp_get_theme();
393
+
394
+ /* Populate the sidebar only for Zerif Lite */
395
+ if ( 'Zerif Lite' == $theme->name || 'Zerif Lite' == $theme->parent_theme ) {
396
+
397
+ $themeisle_companion_flag = get_option( 'themeisle_companion_flag' );
398
+ if ( empty( $themeisle_companion_flag ) && function_exists( 'themeisle_populate_with_default_widgets' ) ) {
399
+ themeisle_populate_with_default_widgets();
400
+ }
401
+ }
402
+ }
403
+
404
+ add_action( 'widgets_init', 'themeisle_register_widgets' );
405
+
406
+ /* Require The Widget Files */
407
+ require_once THEMEISLE_COMPANION_PATH . 'inc/zerif-lite/widgets/widget-focus.php';
408
+ require_once THEMEISLE_COMPANION_PATH . 'inc/zerif-lite/widgets/widget-testimonial.php';
409
+ require_once THEMEISLE_COMPANION_PATH . 'inc/zerif-lite/widgets/widget-clients.php';
410
+ require_once THEMEISLE_COMPANION_PATH . 'inc/zerif-lite/widgets/widget-team.php';
readme.txt CHANGED
@@ -1,24 +1,24 @@
1
- === ThemeIsle Companion ===
2
- Contributors: themeisle, codeinwp, rodicaelena, baicusandrei
3
- Tags: widget, admin, widgets
4
- Requires at least: 3.0
5
- Tested up to: 4.7.2
6
- Stable tag: trunk
7
- License: GPLv2 or later
8
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
-
10
- Creates the Testimonial, Team member, Our focus and Clients widgets in Zerif Lite.
11
-
12
- == Description ==
13
-
14
- This plugin is the companion plugin for Zerif Lite. It creates the widgets "Zerif - Testimonial widget" , "Zerif - Team member widget" , "Zerif - Our focus widget" and "Zerif - Clients widget" in the Zerif Lite theme.
15
-
16
- == Changelog ==
17
-
18
- = 1.0.1 =
19
-
20
- * Changed tested up to
21
-
22
- = 1.0.0 =
23
-
24
- * First version of the plugin
1
+ === ThemeIsle Companion ===
2
+ Contributors: themeisle, codeinwp, rodicaelena, baicusandrei
3
+ Tags: widget, admin, widgets
4
+ Requires at least: 3.0
5
+ Tested up to: 4.7.2
6
+ Stable tag: trunk
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Creates the Testimonial, Team member, Our focus and Clients widgets in Zerif Lite.
11
+
12
+ == Description ==
13
+
14
+ This plugin is the companion plugin for Zerif Lite. It creates the widgets "Zerif - Testimonial widget" , "Zerif - Team member widget" , "Zerif - Our focus widget" and "Zerif - Clients widget" in the Zerif Lite theme.
15
+
16
+ == Changelog ==
17
+
18
+ = 1.0.1 =
19
+
20
+ * Changed tested up to
21
+
22
+ = 1.0.0 =
23
+
24
+ * First version of the plugin
themeisle-companion.php CHANGED
@@ -1,410 +1,43 @@
1
- <?php
2
- /*
3
- Plugin Name: ThemeIsle Companion
4
- Plugin URI: https://github.com/Codeinwp/themeisle-companion
5
- Description: Creates the widgets "Zerif - Testimonial widget" , "Zerif - Team member widget" , "Zerif - Our focus widget" and "Zerif - Clients widget" in the Zerif Lite theme.
6
- Version: 1.0.1
7
- Author: Themeisle
8
- Author URI: http://themeisle.com
9
- Text Domain: themeisle-companion
10
- Domain Path: /languages
11
- License: GPLv2
12
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
13
- */
14
-
15
- define( 'THEMEISLE_COMPANION_VERSION', '1.0.1' );
16
- define( 'THEMEISLE_COMPANION_PATH', plugin_dir_path( __FILE__ ) );
17
- define( 'THEMEISLE_COMPANION_URL', plugin_dir_url( __FILE__ ) );
18
-
19
-
20
- if ( ! function_exists( 'add_action' ) ) {
21
- die('Nothing to do...');
22
- }
23
-
24
- /**
25
- * Populate Zerif frontpage widgets areas with default widgets
26
- */
27
- function themeisle_populate_with_default_widgets() {
28
-
29
- $zerif_lite_sidebars = array ( 'sidebar-ourfocus' => 'sidebar-ourfocus', 'sidebar-testimonials' => 'sidebar-testimonials', 'sidebar-ourteam' => 'sidebar-ourteam', 'sidebar-aboutus' => 'sidebar-aboutus' );
30
-
31
- $active_widgets = get_option( 'sidebars_widgets' );
32
-
33
- /**
34
- * Populate the Our Focus sidebar
35
- */
36
- if ( empty ( $active_widgets[ $zerif_lite_sidebars['sidebar-ourfocus'] ] ) ) {
37
-
38
- $zerif_lite_counter = 1;
39
-
40
- /* our focus widget #1 */
41
-
42
- $active_widgets['sidebar-ourfocus'][0] = 'ctup-ads-widget-' . $zerif_lite_counter;
43
-
44
- if ( file_exists( get_stylesheet_directory() . '/images/parallax.png' ) ) {
45
- $ourfocus_content[ $zerif_lite_counter ] = array(
46
- 'title' => 'PARALLAX EFFECT',
47
- 'text' => 'Create memorable pages with smooth parallax effects that everyone loves. Also, use our lightweight content slider offering you smooth and great-looking animations.',
48
- 'link' => '#',
49
- 'image_uri' => get_stylesheet_directory_uri() . "/images/parallax.png"
50
- );
51
- } else {
52
- $ourfocus_content[ $zerif_lite_counter ] = array(
53
- 'title' => 'PARALLAX EFFECT',
54
- 'text' => 'Create memorable pages with smooth parallax effects that everyone loves. Also, use our lightweight content slider offering you smooth and great-looking animations.',
55
- 'link' => '#',
56
- 'image_uri' => get_template_directory_uri() . "/images/parallax.png"
57
- );
58
- }
59
-
60
- update_option( 'widget_ctup-ads-widget', $ourfocus_content );
61
-
62
- $zerif_lite_counter ++;
63
-
64
- /* our focus widget #2 */
65
-
66
- $active_widgets['sidebar-ourfocus'][] = 'ctup-ads-widget-' . $zerif_lite_counter;
67
-
68
- if ( file_exists( get_stylesheet_directory() . '/images/woo.png' ) ) {
69
- $ourfocus_content[ $zerif_lite_counter ] = array(
70
- 'title' => 'WOOCOMMERCE',
71
- 'text' => 'Build a front page for your WooCommerce store in a matter of minutes. The neat and clean presentation will help your sales and make your store accessible to everyone.',
72
- 'link' => '#',
73
- 'image_uri' => get_stylesheet_directory_uri() . "/images/woo.png"
74
- );
75
- } else {
76
- $ourfocus_content[ $zerif_lite_counter ] = array(
77
- 'title' => 'WOOCOMMERCE',
78
- 'text' => 'Build a front page for your WooCommerce store in a matter of minutes. The neat and clean presentation will help your sales and make your store accessible to everyone.',
79
- 'link' => '#',
80
- 'image_uri' => get_template_directory_uri() . "/images/woo.png"
81
- );
82
- }
83
-
84
- update_option( 'widget_ctup-ads-widget', $ourfocus_content );
85
-
86
- $zerif_lite_counter ++;
87
-
88
- /* our focus widget #3 */
89
-
90
- $active_widgets['sidebar-ourfocus'][] = 'ctup-ads-widget-' . $zerif_lite_counter;
91
-
92
- if ( file_exists( get_stylesheet_directory() . '/images/ccc.png' ) ) {
93
- $ourfocus_content[ $zerif_lite_counter ] = array(
94
- 'title' => 'CUSTOM CONTENT BLOCKS',
95
- 'text' => 'Showcase your team, products, clients, about info, testimonials, latest posts from the blog, contact form, additional calls to action. Everything translation ready.',
96
- 'link' => '#',
97
- 'image_uri' => get_stylesheet_directory_uri() . "/images/ccc.png"
98
- );
99
- } else {
100
- $ourfocus_content[ $zerif_lite_counter ] = array(
101
- 'title' => 'CUSTOM CONTENT BLOCKS',
102
- 'text' => 'Showcase your team, products, clients, about info, testimonials, latest posts from the blog, contact form, additional calls to action. Everything translation ready.',
103
- 'link' => '#',
104
- 'image_uri' => get_template_directory_uri() . "/images/ccc.png"
105
- );
106
- }
107
-
108
- update_option( 'widget_ctup-ads-widget', $ourfocus_content );
109
-
110
- $zerif_lite_counter ++;
111
-
112
- /* our focus widget #4 */
113
-
114
- $active_widgets['sidebar-ourfocus'][] = 'ctup-ads-widget-' . $zerif_lite_counter;
115
-
116
- if ( file_exists( get_stylesheet_directory() . '/images/ti-logo.png' ) ) {
117
- $ourfocus_content[ $zerif_lite_counter ] = array(
118
- 'title' => 'GO PRO FOR MORE FEATURES',
119
- 'text' => 'Get new content blocks: pricing table, Google Maps, and more. Change the sections order, display each block exactly where you need it, customize the blocks with whatever colors you wish.',
120
- 'link' => '#',
121
- 'image_uri' => get_stylesheet_directory_uri() . "/images/ti-logo.png"
122
- );
123
- } else {
124
- $ourfocus_content[ $zerif_lite_counter ] = array(
125
- 'title' => 'GO PRO FOR MORE FEATURES',
126
- 'text' => 'Get new content blocks: pricing table, Google Maps, and more. Change the sections order, display each block exactly where you need it, customize the blocks with whatever colors you wish.',
127
- 'link' => '#',
128
- 'image_uri' => get_template_directory_uri() . "/images/ti-logo.png"
129
- );
130
- }
131
-
132
- update_option( 'widget_ctup-ads-widget', $ourfocus_content );
133
-
134
- $zerif_lite_counter ++;
135
-
136
- update_option( 'sidebars_widgets', $active_widgets );
137
-
138
- }
139
-
140
- /**
141
- * Populate the Testimonials sidebar
142
- */
143
- if ( empty ( $active_widgets[ $zerif_lite_sidebars['sidebar-testimonials'] ] ) ) {
144
-
145
- $zerif_lite_counter = 1;
146
-
147
- /* testimonial widget #1 */
148
-
149
- $active_widgets['sidebar-testimonials'][0] = 'zerif_testim-widget-' . $zerif_lite_counter;
150
-
151
- if ( file_exists( get_stylesheet_directory() . '/images/testimonial1.jpg' ) ) {
152
- $testimonial_content[ $zerif_lite_counter ] = array(
153
- 'title' => 'Dana Lorem',
154
- 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
155
- 'image_uri' => get_stylesheet_directory_uri() . "/images/testimonial1.jpg"
156
- );
157
- } else {
158
- $testimonial_content[ $zerif_lite_counter ] = array(
159
- 'title' => 'Dana Lorem',
160
- 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
161
- 'image_uri' => get_template_directory_uri() . "/images/testimonial1.jpg"
162
- );
163
- }
164
-
165
- update_option( 'widget_zerif_testim-widget', $testimonial_content );
166
-
167
- $zerif_lite_counter ++;
168
-
169
- /* testimonial widget #2 */
170
-
171
- $active_widgets['sidebar-testimonials'][] = 'zerif_testim-widget-' . $zerif_lite_counter;
172
-
173
- if ( file_exists( get_stylesheet_directory() . '/images/testimonial2.jpg' ) ) {
174
- $testimonial_content[ $zerif_lite_counter ] = array(
175
- 'title' => 'Linda Guthrie',
176
- 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
177
- 'image_uri' => get_stylesheet_directory_uri() . "/images/testimonial2.jpg"
178
- );
179
- } else {
180
- $testimonial_content[ $zerif_lite_counter ] = array(
181
- 'title' => 'Linda Guthrie',
182
- 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
183
- 'image_uri' => get_template_directory_uri() . "/images/testimonial2.jpg"
184
- );
185
- }
186
-
187
- update_option( 'widget_zerif_testim-widget', $testimonial_content );
188
-
189
- $zerif_lite_counter ++;
190
-
191
- /* testimonial widget #3 */
192
-
193
- $active_widgets['sidebar-testimonials'][] = 'zerif_testim-widget-' . $zerif_lite_counter;
194
-
195
- if ( file_exists( get_stylesheet_directory() . '/images/testimonial3.jpg' ) ) {
196
- $testimonial_content[ $zerif_lite_counter ] = array(
197
- 'title' => 'Cynthia Henry',
198
- 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
199
- 'image_uri' => get_stylesheet_directory_uri() . "/images/testimonial3.jpg"
200
- );
201
- } else {
202
- $testimonial_content[ $zerif_lite_counter ] = array(
203
- 'title' => 'Cynthia Henry',
204
- 'text' => 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec sem vel sapien venenatis mattis non vitae augue. Nullam congue commodo lorem vitae facilisis. Suspendisse malesuada id turpis interdum dictum.',
205
- 'image_uri' => get_template_directory_uri() . "/images/testimonial3.jpg"
206
- );
207
- }
208
-
209
- update_option( 'widget_zerif_testim-widget', $testimonial_content );
210
-
211
- $zerif_lite_counter ++;
212
-
213
- update_option( 'sidebars_widgets', $active_widgets );
214
- }
215
-
216
- /**
217
- * Populate the Our team sidebar
218
- */
219
- if ( empty ( $active_widgets[ $zerif_lite_sidebars['sidebar-ourteam'] ] ) ) {
220
-
221
- $zerif_lite_counter = 1;
222
-
223
- /* our team widget #1 */
224
-
225
- $active_widgets['sidebar-ourteam'][0] = 'zerif_team-widget-' . $zerif_lite_counter;
226
-
227
- $ourteam_content[ $zerif_lite_counter ] = array( 'name' => 'ASHLEY SIMMONS',
228
- 'position' => 'Project Manager',
229
- 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dapibus, eros at accumsan auctor, felis eros condimentum quam, non porttitor est urna vel neque',
230
- 'fb_link' => '#',
231
- 'tw_link' => '#',
232
- 'bh_link' => '#',
233
- 'db_link' => '#',
234
- 'ln_link' => '#',
235
- 'image_uri' => get_template_directory_uri() . "/images/team1.png"
236
- );
237
-
238
- update_option( 'widget_zerif_team-widget', $ourteam_content );
239
-
240
- $zerif_lite_counter ++;
241
-
242
- /* our team widget #2 */
243
-
244
- $active_widgets['sidebar-ourteam'][] = 'zerif_team-widget-' . $zerif_lite_counter;
245
-
246
- $ourteam_content[ $zerif_lite_counter ] = array( 'name' => 'TIMOTHY SPRAY',
247
- 'position' => 'Art Director',
248
- 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dapibus, eros at accumsan auctor, felis eros condimentum quam, non porttitor est urna vel neque',
249
- 'fb_link' => '#',
250
- 'tw_link' => '#',
251
- 'bh_link' => '#',
252
- 'db_link' => '#',
253
- 'ln_link' => '#',
254
- 'image_uri' => get_template_directory_uri() . "/images/team2.png"
255
- );
256
-
257
- update_option( 'widget_zerif_team-widget', $ourteam_content );
258
-
259
- $zerif_lite_counter ++;
260
-
261
- /* our team widget #3 */
262
-
263
- $active_widgets['sidebar-ourteam'][] = 'zerif_team-widget-' . $zerif_lite_counter;
264
-
265
- $ourteam_content[ $zerif_lite_counter ] = array( 'name' => 'TONYA GARCIA',
266
- 'position' => 'Account Manager',
267
- 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dapibus, eros at accumsan auctor, felis eros condimentum quam, non porttitor est urna vel neque',
268
- 'fb_link' => '#',
269
- 'tw_link' => '#',
270
- 'bh_link' => '#',
271
- 'db_link' => '#',
272
- 'ln_link' => '#',
273
- 'image_uri' => get_template_directory_uri() . "/images/team3.png"
274
- );
275
-
276
- update_option( 'widget_zerif_team-widget', $ourteam_content );
277
-
278
- $zerif_lite_counter ++;
279
-
280
- /* our team widget #4 */
281
-
282
- $active_widgets['sidebar-ourteam'][] = 'zerif_team-widget-' . $zerif_lite_counter;
283
-
284
- $ourteam_content[ $zerif_lite_counter ] = array( 'name' => 'JASON LANE',
285
- 'position' => 'Business Development',
286
- 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dapibus, eros at accumsan auctor, felis eros condimentum quam, non porttitor est urna vel neque',
287
- 'fb_link' => '#',
288
- 'tw_link' => '#',
289
- 'bh_link' => '#',
290
- 'db_link' => '#',
291
- 'ln_link' => '#',
292
- 'image_uri' => get_template_directory_uri() . "/images/team4.png"
293
- );
294
-
295
- update_option( 'widget_zerif_team-widget', $ourteam_content );
296
-
297
- $zerif_lite_counter ++;
298
-
299
- update_option( 'sidebars_widgets', $active_widgets );
300
- }
301
-
302
- /**
303
- * Populate the Aboutus sidebar with Client widgets
304
- */
305
- if ( empty ( $active_widgets[ $zerif_lite_sidebars['sidebar-aboutus'] ] ) ) {
306
-
307
- $zerif_lite_counter = 1;
308
-
309
- /* client widget #1 */
310
-
311
- $active_widgets['sidebar-aboutus'][0] = 'zerif_clients-widget-' . $zerif_lite_counter;
312
-
313
- $client_content[ $zerif_lite_counter ] = array(
314
- 'link' => '#',
315
- 'image_uri' => get_template_directory_uri() . "/images/clients1.png"
316
- );
317
-
318
- update_option( 'widget_zerif_clients-widget', $client_content );
319
-
320
- $zerif_lite_counter ++;
321
-
322
- /* client widget #2 */
323
-
324
- $active_widgets['sidebar-aboutus'][] = 'zerif_clients-widget-' . $zerif_lite_counter;
325
-
326
- $client_content[ $zerif_lite_counter ] = array(
327
- 'link' => '#',
328
- 'image_uri' => get_template_directory_uri() . "/images/clients2.png"
329
- );
330
-
331
- update_option( 'widget_zerif_clients-widget', $client_content );
332
-
333
- $zerif_lite_counter ++;
334
-
335
- update_option( 'sidebars_widgets', $active_widgets );
336
-
337
- /* client widget #3 */
338
-
339
- $active_widgets['sidebar-aboutus'][] = 'zerif_clients-widget-' . $zerif_lite_counter;
340
-
341
- $client_content[ $zerif_lite_counter ] = array(
342
- 'link' => '#',
343
- 'image_uri' => get_template_directory_uri() . "/images/clients3.png"
344
- );
345
-
346
- update_option( 'widget_zerif_clients-widget', $client_content );
347
-
348
- $zerif_lite_counter ++;
349
-
350
- update_option( 'sidebars_widgets', $active_widgets );
351
-
352
- /* client widget #4 */
353
-
354
- $active_widgets['sidebar-aboutus'][] = 'zerif_clients-widget-' . $zerif_lite_counter;
355
-
356
- $client_content[ $zerif_lite_counter ] = array(
357
- 'link' => '#',
358
- 'image_uri' => get_template_directory_uri() . "/images/clients4.png"
359
- );
360
-
361
- update_option( 'widget_zerif_clients-widget', $client_content );
362
-
363
- $zerif_lite_counter ++;
364
-
365
- update_option( 'sidebars_widgets', $active_widgets );
366
-
367
- /* client widget #5 */
368
-
369
- $active_widgets['sidebar-aboutus'][] = 'zerif_clients-widget-' . $zerif_lite_counter;
370
-
371
- $client_content[ $zerif_lite_counter ] = array(
372
- 'link' => '#',
373
- 'image_uri' => get_template_directory_uri() . "/images/clients5.png"
374
- );
375
-
376
- update_option( 'widget_zerif_clients-widget', $client_content );
377
-
378
- $zerif_lite_counter ++;
379
-
380
- update_option( 'sidebars_widgets', $active_widgets );
381
-
382
- }
383
-
384
- update_option( 'themeisle_companion_flag','installed' );
385
-
386
- }
387
-
388
- /**
389
- * Register Zerif Widgets
390
- */
391
- function themeisle_register_widgets() {
392
-
393
- register_widget('zerif_ourfocus');
394
- register_widget('zerif_testimonial_widget');
395
- register_widget('zerif_clients_widget');
396
- register_widget('zerif_team_widget');
397
-
398
- $themeisle_companion_flag = get_option( 'themeisle_companion_flag' );
399
- if ( empty( $themeisle_companion_flag ) && function_exists( 'themeisle_populate_with_default_widgets' ) ) {
400
- themeisle_populate_with_default_widgets();
401
- }
402
-
403
- }
404
-
405
- add_action('widgets_init', 'themeisle_register_widgets');
406
-
407
- require_once THEMEISLE_COMPANION_PATH . 'inc/widget-focus.php';
408
- require_once THEMEISLE_COMPANION_PATH . 'inc/widget-testimonial.php';
409
- require_once THEMEISLE_COMPANION_PATH . 'inc/widget-clients.php';
410
- require_once THEMEISLE_COMPANION_PATH . 'inc/widget-team.php';
1
+ <?php
2
+ /*
3
+ * Plugin Name: ThemeIsle Companion
4
+ * Plugin URI: https://github.com/Codeinwp/themeisle-companion
5
+ * Description: Enhances ThemeIsle's themes with extra functionalities.
6
+ * Version: 1.0.2
7
+ * Author: Themeisle
8
+ * Author URI: http://themeisle.com
9
+ * Text Domain: themeisle-companion
10
+ * Domain Path: /languages
11
+ * License: GPLv2
12
+ * License URI: https://www.gnu.org/licenses/gpl-2.0.html
13
+ */
14
+
15
+ define( 'THEMEISLE_COMPANION_VERSION', '1.0.2' );
16
+ define( 'THEMEISLE_COMPANION_PATH', plugin_dir_path( __FILE__ ) );
17
+ define( 'THEMEISLE_COMPANION_URL', plugin_dir_url( __FILE__ ) );
18
+
19
+
20
+ if ( ! function_exists( 'add_action' ) ) {
21
+ die('Nothing to do...');
22
+ }
23
+ add_action( 'plugins_loaded', 'themeisle_companion_textdomain' );
24
+
25
+ /**
26
+ * Load plugin textdomain.
27
+ */
28
+ function themeisle_companion_textdomain() {
29
+ load_plugin_textdomain( 'themeisle-companion', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
30
+ }
31
+
32
+
33
+ function themeisle_companion_loader() {
34
+ if ( function_exists( 'zerif_setup' ) ) {
35
+ require_once( THEMEISLE_COMPANION_PATH . 'inc/zerif-lite/zerif-lite-functions.php' );
36
+ }
37
+
38
+ if ( function_exists( 'hestia_setup_theme' ) ) {
39
+ require_once( THEMEISLE_COMPANION_PATH . 'inc/hestia/hestia-functions.php' );
40
+ }
41
+ }
42
+
43
+ add_action( 'after_setup_theme', 'themeisle_companion_loader', 0 );