Header Footer Elementor - Version 1.0.8

Version Description

  • Allow filters to override the WP_Query parameters when retreiving the Header / Footer template id.
Download this release

Release Info

Developer Nikschavan
Plugin Icon Header Footer Elementor
Version 1.0.8
Comparing to
See all releases

Code changes from version 1.0.7 to 1.0.8

header-footer-elementor.php CHANGED
@@ -7,12 +7,12 @@
7
* Author URI: https://www.brainstormforce.com/
8
* Text Domain: header-footer-elementor
9
* Domain Path: /languages
10
- * Version: 1.0.7
11
*
12
* @package header-footer-elementor
13
*/
14
15
- define( 'HFE_VER', '1.0.7' );
16
define( 'HFE_DIR', plugin_dir_path( __FILE__ ) );
17
define( 'HFE_URL', plugins_url( '/', __FILE__ ) );
18
define( 'HFE_PATH', plugin_basename( __FILE__ ) );
7
* Author URI: https://www.brainstormforce.com/
8
* Text Domain: header-footer-elementor
9
* Domain Path: /languages
10
+ * Version: 1.0.8
11
*
12
* @package header-footer-elementor
13
*/
14
15
+ define( 'HFE_VER', '1.0.8' );
16
define( 'HFE_DIR', plugin_dir_path( __FILE__ ) );
17
define( 'HFE_URL', plugins_url( '/', __FILE__ ) );
18
define( 'HFE_PATH', plugin_basename( __FILE__ ) );
inc/class-header-footer-elementor.php CHANGED
@@ -59,7 +59,6 @@ class Header_Footer_Elementor {
59
// Scripts and styles.
60
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
61
add_filter( 'body_class', array( $this, 'body_class' ) );
62
- add_action( 'admin_init', array( $this, 'setup_notices' ) );
63
64
} else {
65
@@ -98,7 +97,8 @@ class Header_Footer_Elementor {
98
require_once HFE_DIR . 'inc/class-hfe-elementor-canvas-compat.php';
99
100
// Load the Admin Notice Class.
101
- require_once HFE_DIR . 'inc/class-hfe-notices.php';
102
}
103
104
/**
@@ -170,37 +170,6 @@ class Header_Footer_Elementor {
170
printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
171
}
172
173
- /**
174
- * Setup admin notice
175
- */
176
- public function setup_notices() {
177
-
178
- $url = add_query_arg(
179
- array(
180
- 'utm_source' => 'hfe-notice',
181
- 'utm_campaign' => 'header-footer-elementor',
182
- 'utm_medium' => 'blackfriday-notice',
183
- 'bsf' => '162',
184
- ), 'https://www.brainstormforce.com/deals/2017-black-friday-cyber-monday-wordpress-deals/'
185
- );
186
-
187
- HFE_Notices::add_notice(
188
- array(
189
- 'id' => 'hfe-blackfriday-sale',
190
- 'type' => 'info',
191
- 'show_if' => true,
192
- 'message' => sprintf(
193
- /* translators: 1: Link to the blackfriday deals */
194
- __( 'Thanks for updating Header Footer Elementor. Black Friday is here with huge savings! See our hand curated list of <a href="%1$s">Best WordPress Deals</a>!', 'header-footer-elementor' ),
195
- esc_url( $url )
196
- ),
197
- 'dismissible' => true,
198
- 'dismissible-time' => WEEK_IN_SECONDS,
199
- )
200
- );
201
-
202
- }
203
-
204
/**
205
* Prints the Header content.
206
*/
@@ -249,25 +218,29 @@ class Header_Footer_Elementor {
249
return $cached;
250
}
251
252
- $template = new WP_Query(
253
- array(
254
- 'post_type' => 'elementor-hf',
255
- 'meta_key' => 'ehf_template_type',
256
- 'meta_value' => $type,
257
- 'meta_type' => 'post',
258
- 'meta_compare' => '>=',
259
- 'orderby' => 'meta_value',
260
- 'order' => 'ASC',
261
- 'meta_query' => array(
262
- 'relation' => 'OR',
263
- array(
264
- 'key' => 'ehf_template_type',
265
- 'value' => $type,
266
- 'compare' => '==',
267
- 'type' => 'post',
268
- ),
269
),
270
- )
271
);
272
273
if ( $template->have_posts() ) {
59
// Scripts and styles.
60
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
61
add_filter( 'body_class', array( $this, 'body_class' ) );
62
63
} else {
64
97
require_once HFE_DIR . 'inc/class-hfe-elementor-canvas-compat.php';
98
99
// Load the Admin Notice Class.
100
+ // Stop loading the comments class until it is required the next time.
101
+ // require_once HFE_DIR . 'inc/class-hfe-notices.php';.
102
}
103
104
/**
170
printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
171
}
172
173
/**
174
* Prints the Header content.
175
*/
218
return $cached;
219
}
220
221
+ $args = array(
222
+ 'post_type' => 'elementor-hf',
223
+ 'meta_key' => 'ehf_template_type',
224
+ 'meta_value' => $type,
225
+ 'meta_type' => 'post',
226
+ 'meta_compare' => '>=',
227
+ 'orderby' => 'meta_value',
228
+ 'order' => 'ASC',
229
+ 'meta_query' => array(
230
+ 'relation' => 'OR',
231
+ array(
232
+ 'key' => 'ehf_template_type',
233
+ 'value' => $type,
234
+ 'compare' => '==',
235
+ 'type' => 'post',
236
),
237
+ ),
238
+ );
239
+
240
+ $args = apply_filters( 'hfe_get_template_id_args', $args );
241
+
242
+ $template = new WP_Query(
243
+ $args
244
);
245
246
if ( $template->have_posts() ) {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: brainstormforce, Nikschavan
3
Tags: elementor, header footer builder, header, footer, page builder, template builder, landing page builder, front-end editor
4
Donate link: https://www.paypal.me/BrainstormForce
5
Requires at least: 4.4
6
- Tested up to: 4.9.0
7
- Stable tag: 1.0.7
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -72,6 +72,9 @@ If you are a theme developer <a href="https://github.com/Nikschavan/header-foote
72
73
== Changelog ==
74
75
= 1.0.7 =
76
- Fix: Dismissable notice not actually dismissing.
77
3
Tags: elementor, header footer builder, header, footer, page builder, template builder, landing page builder, front-end editor
4
Donate link: https://www.paypal.me/BrainstormForce
5
Requires at least: 4.4
6
+ Tested up to: 4.9.1
7
+ Stable tag: 1.0.8
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
72
73
== Changelog ==
74
75
+ = 1.0.8 =
76
+ - Allow filters to override the WP_Query parameters when retreiving the Header / Footer template id.
77
+
78
= 1.0.7 =
79
- Fix: Dismissable notice not actually dismissing.
80