Version Description
- New: Rename plugin to be Header Footer & Blocks builder as now thee blocks templates can be used as shortcodes.
- New: Add templates before the footer for Astra Theme. Options for other themes will be cominng soon.
- New: Use templates (Blocks) anywhere in your content with the help of shortcodes.
- Improvement: Improved the UI of the metabox for Header Footer post type.
Download this release
Release Info
Developer | Nikschavan |
Plugin | Header Footer Elementor |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.16 to 1.1.0
- admin/assets/css/ehf-admin.css +64 -0
- admin/assets/js/ehf-admin.js +22 -0
- admin/class-hfe-admin.php +94 -17
- header-footer-elementor.php +3 -3
- inc/class-header-footer-elementor.php +52 -1
- languages/header-footer-elementor.pot +47 -29
- readme.txt +11 -5
- themes/astra/class-hfe-astra-compat.php +96 -0
admin/assets/css/ehf-admin.css
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
span.hfe-shortcode-col-wrap > input {
|
2 |
+
background: inherit;
|
3 |
+
color: inherit;
|
4 |
+
font-size: 12px;
|
5 |
+
border: none;
|
6 |
+
box-shadow: none;
|
7 |
+
padding: 4px 8px;
|
8 |
+
margin: 0;
|
9 |
+
}
|
10 |
+
|
11 |
+
input.hfe-large-text{
|
12 |
+
width: 99%;
|
13 |
+
}
|
14 |
+
|
15 |
+
.hfe-options-row-heading {
|
16 |
+
border-right: 1px solid #E1E1E1;
|
17 |
+
padding: 15px;
|
18 |
+
width: 45%;
|
19 |
+
vertical-align: middle;
|
20 |
+
}
|
21 |
+
|
22 |
+
.hfe-options-row td {
|
23 |
+
padding-left: 12px;
|
24 |
+
padding-right: 12px;
|
25 |
+
border-bottom: 1px solid #f0f0f0;
|
26 |
+
zoom: 1;
|
27 |
+
vertical-align: middle;
|
28 |
+
}
|
29 |
+
|
30 |
+
.hfe-options-table .hfe-options-row-content {
|
31 |
+
padding: 15px 10px;
|
32 |
+
position: relative;
|
33 |
+
width: 55%;
|
34 |
+
}
|
35 |
+
|
36 |
+
.hfe-options-table.widefat{
|
37 |
+
border-width: 0;
|
38 |
+
}
|
39 |
+
|
40 |
+
#ehf-meta-box .inside {
|
41 |
+
margin: 0;
|
42 |
+
padding: 0;
|
43 |
+
}
|
44 |
+
|
45 |
+
.hfe-options-row-heading label {
|
46 |
+
display: inline-block;
|
47 |
+
font-size: 13px;
|
48 |
+
line-height: 1.4em;
|
49 |
+
font-weight: bold;
|
50 |
+
padding: 0;
|
51 |
+
margin: 0 0 3px;
|
52 |
+
color: #333;
|
53 |
+
}
|
54 |
+
|
55 |
+
.hfe-options-table #ehf_template_type {
|
56 |
+
width: 80%;
|
57 |
+
}
|
58 |
+
|
59 |
+
.hfe-options-row-heading-help{
|
60 |
+
color: #b3b3b3;
|
61 |
+
cursor: help;
|
62 |
+
float: right;
|
63 |
+
font-size: 18px;
|
64 |
+
}
|
admin/assets/js/ehf-admin.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
|
3 |
+
var ehf_hide_shortcode_field = function() {
|
4 |
+
|
5 |
+
var selected = jQuery('#ehf_template_type').val();
|
6 |
+
|
7 |
+
if( 'custom' == selected ) {
|
8 |
+
jQuery( '.hfe-options-row.hfe-shortcode' ).show();
|
9 |
+
} else {
|
10 |
+
jQuery( '.hfe-options-row.hfe-shortcode' ).hide();
|
11 |
+
}
|
12 |
+
}
|
13 |
+
|
14 |
+
jQuery(document).on( 'change', '#ehf_template_type', function( e ) {
|
15 |
+
|
16 |
+
ehf_hide_shortcode_field();
|
17 |
+
|
18 |
+
});
|
19 |
+
|
20 |
+
ehf_hide_shortcode_field();
|
21 |
+
|
22 |
+
});
|
admin/class-hfe-admin.php
CHANGED
@@ -45,6 +45,11 @@ class HFE_Admin {
|
|
45 |
add_action( 'admin_notices', array( $this, 'location_notice' ) );
|
46 |
add_action( 'template_redirect', array( $this, 'block_template_frontend' ) );
|
47 |
add_filter( 'single_template', array( $this, 'load_canvas_template' ) );
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -108,10 +113,15 @@ class HFE_Admin {
|
|
108 |
*/
|
109 |
function ehf_register_metabox() {
|
110 |
add_meta_box(
|
111 |
-
'ehf-meta-box',
|
|
|
|
|
112 |
$this,
|
113 |
'efh_metabox_render',
|
114 |
-
),
|
|
|
|
|
|
|
115 |
);
|
116 |
}
|
117 |
|
@@ -128,21 +138,49 @@ class HFE_Admin {
|
|
128 |
// We'll use this nonce field later on when saving.
|
129 |
wp_nonce_field( 'ehf_meta_nounce', 'ehf_meta_nounce' );
|
130 |
?>
|
131 |
-
<
|
132 |
-
<
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
<?php
|
147 |
}
|
148 |
|
@@ -269,6 +307,45 @@ class HFE_Admin {
|
|
269 |
return $single_template;
|
270 |
}
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
}
|
273 |
|
274 |
HFE_Admin::instance();
|
45 |
add_action( 'admin_notices', array( $this, 'location_notice' ) );
|
46 |
add_action( 'template_redirect', array( $this, 'block_template_frontend' ) );
|
47 |
add_filter( 'single_template', array( $this, 'load_canvas_template' ) );
|
48 |
+
|
49 |
+
add_filter( 'manage_elementor-hf_posts_columns', array( $this, 'set_shortcode_columns' ) );
|
50 |
+
|
51 |
+
add_action( 'manage_elementor-hf_posts_custom_column', array( $this, 'render_shortcode_column' ), 10, 2 );
|
52 |
+
|
53 |
}
|
54 |
|
55 |
/**
|
113 |
*/
|
114 |
function ehf_register_metabox() {
|
115 |
add_meta_box(
|
116 |
+
'ehf-meta-box',
|
117 |
+
__( 'Elementor Header Footer options', 'header-footer-elementor' ),
|
118 |
+
array(
|
119 |
$this,
|
120 |
'efh_metabox_render',
|
121 |
+
),
|
122 |
+
'elementor-hf',
|
123 |
+
'normal',
|
124 |
+
'high'
|
125 |
);
|
126 |
}
|
127 |
|
138 |
// We'll use this nonce field later on when saving.
|
139 |
wp_nonce_field( 'ehf_meta_nounce', 'ehf_meta_nounce' );
|
140 |
?>
|
141 |
+
<table class="hfe-options-table widefat">
|
142 |
+
<tbody>
|
143 |
+
<tr class="hfe-options-row">
|
144 |
+
<td class="hfe-options-row-heading">
|
145 |
+
<label for="ehf_template_type"><?php _e( 'Type of Template', 'header-footer-elementor' ); ?></label>
|
146 |
+
</td>
|
147 |
+
<td class="hfe-options-row-content">
|
148 |
+
<select name="ehf_template_type" id="ehf_template_type">
|
149 |
+
<option value="" <?php selected( $template_type, '' ); ?>><?php _e( 'Select Option', 'header-footer-elementor' ); ?></option>
|
150 |
+
<option value="type_header" <?php selected( $template_type, 'type_header' ); ?>><?php _e( 'Header', 'header-footer-elementor' ); ?></option>
|
151 |
+
<?php if ( 'astra' == get_template() ) { ?>
|
152 |
+
<option value="type_before_footer" <?php selected( $template_type, 'type_before_footer' ); ?>><?php _e( 'Before Footer', 'header-footer-elementor' ); ?></option>
|
153 |
+
<?php } ?>
|
154 |
+
<option value="type_footer" <?php selected( $template_type, 'type_footer' ); ?>><?php _e( 'Footer', 'header-footer-elementor' ); ?></option>
|
155 |
+
<option value="custom" <?php selected( $template_type, 'custom' ); ?>><?php _e( 'Custom Block', 'header-footer-elementor' ); ?></option>
|
156 |
+
</select>
|
157 |
+
</td>
|
158 |
+
</tr>
|
159 |
+
<tr class="hfe-options-row hfe-shortcode">
|
160 |
+
<td class="hfe-options-row-heading">
|
161 |
+
<label for="ehf_template_type"><?php _e( 'Shortcode', 'header-footer-elementor' ); ?></label>
|
162 |
+
<i class="hfe-options-row-heading-help dashicons dashicons-editor-help" title="<?php _e( 'Copy this shortcode and paste it into your post, page, or text widget content.', 'header-footer-elementor' ); ?>">
|
163 |
+
</i>
|
164 |
+
</td>
|
165 |
+
<td class="hfe-options-row-content">
|
166 |
+
<span class="hfe-shortcode-col-wrap">
|
167 |
+
<input type="text" onfocus="this.select();" readonly="readonly" value="[hfe_template id='<?php echo esc_attr( $post->ID ); ?>']" class="hfe-large-text code">
|
168 |
+
</span>
|
169 |
+
</td>
|
170 |
+
</tr>
|
171 |
+
<tr class="hfe-options-row">
|
172 |
+
<td class="hfe-options-row-heading">
|
173 |
+
<label for="display-on-canvas-template">
|
174 |
+
<?php _e( 'Enable Layout for Elementor Canvas Template?', 'header-footer-elementor' ); ?>
|
175 |
+
</label>
|
176 |
+
<i class="hfe-options-row-heading-help dashicons dashicons-editor-help" title="<?php _e( 'Enabling this option will display this layout on pages using Elementor Canvas Template.', 'header-footer-elementor' ); ?>"></i>
|
177 |
+
</td>
|
178 |
+
<td class="hfe-options-row-content">
|
179 |
+
<input type="checkbox" id="display-on-canvas-template" name="display-on-canvas-template" value="1" <?php checked( $display_on_canvas, true ); ?> />
|
180 |
+
</td>
|
181 |
+
</tr>
|
182 |
+
</tbody>
|
183 |
+
</table>
|
184 |
<?php
|
185 |
}
|
186 |
|
307 |
return $single_template;
|
308 |
}
|
309 |
|
310 |
+
/**
|
311 |
+
* Set shortcode column for template list.
|
312 |
+
*
|
313 |
+
* @param array $columns template list columns.
|
314 |
+
*/
|
315 |
+
function set_shortcode_columns( $columns ) {
|
316 |
+
|
317 |
+
$date_column = $columns['date'];
|
318 |
+
|
319 |
+
unset( $columns['date'] );
|
320 |
+
|
321 |
+
$columns['shortcode'] = __( 'Shortcode', 'header-footer-elementor' );
|
322 |
+
$columns['date'] = $date_column;
|
323 |
+
|
324 |
+
return $columns;
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Display shortcode in template list column.
|
329 |
+
*
|
330 |
+
* @param array $column template list column.
|
331 |
+
* @param int $post_id post id.
|
332 |
+
*/
|
333 |
+
function render_shortcode_column( $column, $post_id ) {
|
334 |
+
|
335 |
+
switch ( $column ) {
|
336 |
+
case 'shortcode':
|
337 |
+
ob_start();
|
338 |
+
?>
|
339 |
+
<span class="hfe-shortcode-col-wrap">
|
340 |
+
<input type="text" onfocus="this.select();" readonly="readonly" value="[hfe_template id='<?php echo esc_attr( $post_id ); ?>']" class="hfe-large-text code">
|
341 |
+
</span>
|
342 |
+
|
343 |
+
<?php
|
344 |
+
|
345 |
+
ob_get_contents();
|
346 |
+
break;
|
347 |
+
}
|
348 |
+
}
|
349 |
}
|
350 |
|
351 |
HFE_Admin::instance();
|
header-footer-elementor.php
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Plugin Name: Header Footer Elementor
|
4 |
* Plugin URI: https://github.com/Nikschavan/header-footer-elementor
|
5 |
* Description: Create Header and Footer for your site using Elementor Page Builder.
|
6 |
* Author: Brainstorm Force, Nikhil Chavan
|
7 |
* Author URI: https://www.brainstormforce.com/
|
8 |
* Text Domain: header-footer-elementor
|
9 |
* Domain Path: /languages
|
10 |
-
* Version: 1.0
|
11 |
*
|
12 |
* @package header-footer-elementor
|
13 |
*/
|
14 |
|
15 |
-
define( 'HFE_VER', '1.0
|
16 |
define( 'HFE_DIR', plugin_dir_path( __FILE__ ) );
|
17 |
define( 'HFE_URL', plugins_url( '/', __FILE__ ) );
|
18 |
define( 'HFE_PATH', plugin_basename( __FILE__ ) );
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Plugin Name: Header, Footer & Blocks for Elementor
|
4 |
* Plugin URI: https://github.com/Nikschavan/header-footer-elementor
|
5 |
* Description: Create Header and Footer for your site using Elementor Page Builder.
|
6 |
* Author: Brainstorm Force, Nikhil Chavan
|
7 |
* Author URI: https://www.brainstormforce.com/
|
8 |
* Text Domain: header-footer-elementor
|
9 |
* Domain Path: /languages
|
10 |
+
* Version: 1.1.0
|
11 |
*
|
12 |
* @package header-footer-elementor
|
13 |
*/
|
14 |
|
15 |
+
define( 'HFE_VER', '1.1.0' );
|
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
@@ -58,9 +58,14 @@ class Header_Footer_Elementor {
|
|
58 |
|
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( 'switch_theme', array( $this, 'reset_unsupported_theme_notice' ) );
|
63 |
|
|
|
|
|
64 |
} else {
|
65 |
|
66 |
add_action( 'admin_notices', array( $this, 'elementor_not_available' ) );
|
@@ -154,6 +159,20 @@ class Header_Footer_Elementor {
|
|
154 |
}
|
155 |
}
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
/**
|
158 |
* Adds classes to the body tag conditionally.
|
159 |
*
|
@@ -223,7 +242,7 @@ class Header_Footer_Elementor {
|
|
223 |
* @return mixed.
|
224 |
*/
|
225 |
public static function get_settings( $setting = '', $default = '' ) {
|
226 |
-
if ( 'type_header' == $setting || 'type_footer' == $setting ) {
|
227 |
$templates = self::get_template_id( $setting );
|
228 |
|
229 |
$template = is_array( $templates ) ? $templates[0] : '';
|
@@ -283,4 +302,36 @@ class Header_Footer_Elementor {
|
|
283 |
return '';
|
284 |
}
|
285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
}
|
58 |
|
59 |
// Scripts and styles.
|
60 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
61 |
+
|
62 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
|
63 |
+
|
64 |
add_filter( 'body_class', array( $this, 'body_class' ) );
|
65 |
add_action( 'switch_theme', array( $this, 'reset_unsupported_theme_notice' ) );
|
66 |
|
67 |
+
add_shortcode( 'hfe_template', array( $this, 'render_template' ) );
|
68 |
+
|
69 |
} else {
|
70 |
|
71 |
add_action( 'admin_notices', array( $this, 'elementor_not_available' ) );
|
159 |
}
|
160 |
}
|
161 |
|
162 |
+
/**
|
163 |
+
* Load admin styles on header footer elementor edit screen.
|
164 |
+
*/
|
165 |
+
public function enqueue_admin_scripts() {
|
166 |
+
global $pagenow;
|
167 |
+
$screen = get_current_screen();
|
168 |
+
|
169 |
+
if ( ( 'elementor-hf' == $screen->id && ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) ) || ( 'edit.php' == $pagenow && 'edit-elementor-hf' == $screen->id ) ) {
|
170 |
+
wp_enqueue_style( 'hfe-admin-style', HFE_URL . 'admin/assets/css/ehf-admin.css', array(), HFE_VER );
|
171 |
+
|
172 |
+
wp_enqueue_script( 'hfe-admin-script', HFE_URL . 'admin/assets/js/ehf-admin.js', array(), HFE_VER );
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
/**
|
177 |
* Adds classes to the body tag conditionally.
|
178 |
*
|
242 |
* @return mixed.
|
243 |
*/
|
244 |
public static function get_settings( $setting = '', $default = '' ) {
|
245 |
+
if ( 'type_header' == $setting || 'type_footer' == $setting || 'type_before_footer' == $setting ) {
|
246 |
$templates = self::get_template_id( $setting );
|
247 |
|
248 |
$template = is_array( $templates ) ? $templates[0] : '';
|
302 |
return '';
|
303 |
}
|
304 |
|
305 |
+
/**
|
306 |
+
* Callback to shortcode.
|
307 |
+
*
|
308 |
+
* @param array $atts attributes for shortcode.
|
309 |
+
*/
|
310 |
+
public function render_template( $atts ) {
|
311 |
+
|
312 |
+
$atts = shortcode_atts(
|
313 |
+
array(
|
314 |
+
'id' => '',
|
315 |
+
),
|
316 |
+
$atts,
|
317 |
+
'hfe_template'
|
318 |
+
);
|
319 |
+
|
320 |
+
$id = ! empty( $atts['id'] ) ? intval( $atts['id'] ) : '';
|
321 |
+
|
322 |
+
if ( empty( $id ) ) {
|
323 |
+
return '';
|
324 |
+
}
|
325 |
+
|
326 |
+
if ( class_exists( '\Elementor\Post_CSS_File' ) ) {
|
327 |
+
|
328 |
+
// Load elementor styles.
|
329 |
+
$css_file = new \Elementor\Post_CSS_File( $id );
|
330 |
+
$css_file->enqueue();
|
331 |
+
}
|
332 |
+
|
333 |
+
return self::$elementor_instance->frontend->get_builder_content_for_display( $id );
|
334 |
+
|
335 |
+
}
|
336 |
+
|
337 |
}
|
languages/header-footer-elementor.pot
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
# Copyright (C) 2018 Brainstorm Force, Nikhil Chavan
|
2 |
-
# This file is distributed under the same license as the Header Footer Elementor package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Header Footer Elementor 1.0
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/header-footer-elementor\n"
|
8 |
-
"POT-Creation-Date: 2018-
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -25,101 +25,119 @@ msgstr ""
|
|
25 |
"X-Textdomain-Support: yes\n"
|
26 |
"X-Generator: grunt-wp-i18n1.0.2\n"
|
27 |
|
28 |
-
#: admin/class-hfe-admin.php:
|
29 |
msgid "Header Footers Template"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: admin/class-hfe-admin.php:
|
33 |
msgid "Elementor Header Footer"
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: admin/class-hfe-admin.php:
|
37 |
msgid "Add New"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: admin/class-hfe-admin.php:
|
41 |
msgid "Add New Header Footer"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: admin/class-hfe-admin.php:
|
45 |
msgid "New Header Footers Template"
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: admin/class-hfe-admin.php:
|
49 |
msgid "Edit Header Footers Template"
|
50 |
msgstr ""
|
51 |
|
52 |
-
#: admin/class-hfe-admin.php:
|
53 |
msgid "View Header Footers Template"
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: admin/class-hfe-admin.php:
|
57 |
msgid "All Elementor Header Footers"
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: admin/class-hfe-admin.php:
|
61 |
msgid "Search Header Footers Templates"
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: admin/class-hfe-admin.php:
|
65 |
msgid "Parent Header Footers Templates:"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: admin/class-hfe-admin.php:
|
69 |
msgid "No Header Footers Templates found."
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: admin/class-hfe-admin.php:
|
73 |
msgid "No Header Footers Templates found in Trash."
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: admin/class-hfe-admin.php:
|
77 |
msgid "Header Footer Builder"
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: admin/class-hfe-admin.php:
|
81 |
msgid "Elementor Header Footer options"
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: admin/class-hfe-admin.php:
|
85 |
-
msgid "
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: admin/class-hfe-admin.php:
|
89 |
msgid "Select Option"
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: admin/class-hfe-admin.php:
|
93 |
msgid "Header"
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: admin/class-hfe-admin.php:
|
|
|
|
|
|
|
|
|
97 |
msgid "Footer"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: admin/class-hfe-admin.php:
|
101 |
-
msgid "
|
102 |
msgstr ""
|
103 |
|
104 |
-
#: admin/class-hfe-admin.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
msgid ""
|
106 |
"Enabling this option will display this layout on pages using Elementor "
|
107 |
"Canvas Template."
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: admin/class-hfe-admin.php:
|
111 |
#. Translators: Post title, Template Location
|
112 |
msgid "Template %1$s is already assigned to the location %2$s"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: inc/class-header-footer-elementor.php:
|
116 |
#. Translators: URL to install or activate Elementor plugin.
|
117 |
msgid ""
|
118 |
"The <strong>Header Footer Elementor</strong> plugin requires <strong><a "
|
119 |
"href=\"%s\">Elementor</strong></a> plugin installed & activated."
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: inc/class-header-footer-elementor.php:
|
123 |
msgid ""
|
124 |
"Hey, your current theme is not supported by Header Footer Elementor, click "
|
125 |
"<a "
|
@@ -128,7 +146,7 @@ msgid ""
|
|
128 |
msgstr ""
|
129 |
|
130 |
#. Plugin Name of the plugin/theme
|
131 |
-
msgid "Header Footer Elementor"
|
132 |
msgstr ""
|
133 |
|
134 |
#. Plugin URI of the plugin/theme
|
1 |
# Copyright (C) 2018 Brainstorm Force, Nikhil Chavan
|
2 |
+
# This file is distributed under the same license as the Header, Footer & Blocks for Elementor package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Header, Footer & Blocks for Elementor 1.1.0\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/header-footer-elementor\n"
|
8 |
+
"POT-Creation-Date: 2018-12-19 16:58:13+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
25 |
"X-Textdomain-Support: yes\n"
|
26 |
"X-Generator: grunt-wp-i18n1.0.2\n"
|
27 |
|
28 |
+
#: admin/class-hfe-admin.php:61 admin/class-hfe-admin.php:63
|
29 |
msgid "Header Footers Template"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: admin/class-hfe-admin.php:62 admin/class-hfe-admin.php:64
|
33 |
msgid "Elementor Header Footer"
|
34 |
msgstr ""
|
35 |
|
36 |
+
#: admin/class-hfe-admin.php:65
|
37 |
msgid "Add New"
|
38 |
msgstr ""
|
39 |
|
40 |
+
#: admin/class-hfe-admin.php:66
|
41 |
msgid "Add New Header Footer"
|
42 |
msgstr ""
|
43 |
|
44 |
+
#: admin/class-hfe-admin.php:67
|
45 |
msgid "New Header Footers Template"
|
46 |
msgstr ""
|
47 |
|
48 |
+
#: admin/class-hfe-admin.php:68
|
49 |
msgid "Edit Header Footers Template"
|
50 |
msgstr ""
|
51 |
|
52 |
+
#: admin/class-hfe-admin.php:69
|
53 |
msgid "View Header Footers Template"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: admin/class-hfe-admin.php:70
|
57 |
msgid "All Elementor Header Footers"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: admin/class-hfe-admin.php:71
|
61 |
msgid "Search Header Footers Templates"
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: admin/class-hfe-admin.php:72
|
65 |
msgid "Parent Header Footers Templates:"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: admin/class-hfe-admin.php:73
|
69 |
msgid "No Header Footers Templates found."
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: admin/class-hfe-admin.php:74
|
73 |
msgid "No Header Footers Templates found in Trash."
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: admin/class-hfe-admin.php:104 admin/class-hfe-admin.php:105
|
77 |
msgid "Header Footer Builder"
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: admin/class-hfe-admin.php:117
|
81 |
msgid "Elementor Header Footer options"
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: admin/class-hfe-admin.php:145
|
85 |
+
msgid "Type of Template"
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: admin/class-hfe-admin.php:149
|
89 |
msgid "Select Option"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: admin/class-hfe-admin.php:150
|
93 |
msgid "Header"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: admin/class-hfe-admin.php:152
|
97 |
+
msgid "Before Footer"
|
98 |
+
msgstr ""
|
99 |
+
|
100 |
+
#: admin/class-hfe-admin.php:154
|
101 |
msgid "Footer"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: admin/class-hfe-admin.php:155
|
105 |
+
msgid "Custom Block"
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: admin/class-hfe-admin.php:161 admin/class-hfe-admin.php:321
|
109 |
+
msgid "Shortcode"
|
110 |
+
msgstr ""
|
111 |
+
|
112 |
+
#: admin/class-hfe-admin.php:162
|
113 |
+
msgid ""
|
114 |
+
"Copy this shortcode and paste it into your post, page, or text widget "
|
115 |
+
"content."
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: admin/class-hfe-admin.php:174
|
119 |
+
msgid "Enable Layout for Elementor Canvas Template?"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: admin/class-hfe-admin.php:176
|
123 |
msgid ""
|
124 |
"Enabling this option will display this layout on pages using Elementor "
|
125 |
"Canvas Template."
|
126 |
msgstr ""
|
127 |
|
128 |
+
#: admin/class-hfe-admin.php:248
|
129 |
#. Translators: Post title, Template Location
|
130 |
msgid "Template %1$s is already assigned to the location %2$s"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: inc/class-header-footer-elementor.php:101
|
134 |
#. Translators: URL to install or activate Elementor plugin.
|
135 |
msgid ""
|
136 |
"The <strong>Header Footer Elementor</strong> plugin requires <strong><a "
|
137 |
"href=\"%s\">Elementor</strong></a> plugin installed & activated."
|
138 |
msgstr ""
|
139 |
|
140 |
+
#: inc/class-header-footer-elementor.php:212
|
141 |
msgid ""
|
142 |
"Hey, your current theme is not supported by Header Footer Elementor, click "
|
143 |
"<a "
|
146 |
msgstr ""
|
147 |
|
148 |
#. Plugin Name of the plugin/theme
|
149 |
+
msgid "Header, Footer & Blocks for Elementor"
|
150 |
msgstr ""
|
151 |
|
152 |
#. Plugin URI of the plugin/theme
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
=== Header Footer Elementor ===
|
2 |
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 |
Requires PHP: 5.4
|
7 |
-
Tested up to:
|
8 |
-
Stable tag: 1.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -88,11 +88,17 @@ If the above is nnot possible, You can also add support for the plugin from your
|
|
88 |
|
89 |
== Screenshots ==
|
90 |
|
91 |
-
1. Go to
|
92 |
2. After the template is ready, assign it to be a header or footer replacement.
|
93 |
|
94 |
== Changelog ==
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
= 1.0.16 =
|
97 |
- Fix: Make the theme not supported notice dismissable.
|
98 |
- Fix: Use specific selector when adding z-index for the header.
|
@@ -153,4 +159,4 @@ If the above is nnot possible, You can also add support for the plugin from your
|
|
153 |
* Use Elemenntor's canvas template when designing header and footer layout to have full width experience.
|
154 |
|
155 |
= 1.0.0 =
|
156 |
-
* Initial Release.
|
1 |
+
=== Header, Footer & Blocks for Elementor ===
|
2 |
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 |
Requires PHP: 5.4
|
7 |
+
Tested up to: 5.0
|
8 |
+
Stable tag: 1.1.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
88 |
|
89 |
== Screenshots ==
|
90 |
|
91 |
+
1. Go to Appearance -> Header Footer Builder to create a new template.
|
92 |
2. After the template is ready, assign it to be a header or footer replacement.
|
93 |
|
94 |
== Changelog ==
|
95 |
|
96 |
+
= 1.1.0 =
|
97 |
+
- New: Rename plugin to be Header Footer & Blocks builder as now thee blocks templates can be used as shortcodes.
|
98 |
+
- New: Add templates before the footer for Astra Theme. Options for other themes will be cominng soon.
|
99 |
+
- New: Use templates (Blocks) anywhere in your content with the help of shortcodes.
|
100 |
+
- Improvement: Improved the UI of the metabox for Header Footer post type.
|
101 |
+
|
102 |
= 1.0.16 =
|
103 |
- Fix: Make the theme not supported notice dismissable.
|
104 |
- Fix: Use specific selector when adding z-index for the header.
|
159 |
* Use Elemenntor's canvas template when designing header and footer layout to have full width experience.
|
160 |
|
161 |
= 1.0.0 =
|
162 |
+
* Initial Release.
|
themes/astra/class-hfe-astra-compat.php
CHANGED
@@ -17,6 +17,13 @@ class HFE_Astra_Compat {
|
|
17 |
*/
|
18 |
private static $instance;
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
/**
|
21 |
* Initiator
|
22 |
*/
|
@@ -28,6 +35,12 @@ class HFE_Astra_Compat {
|
|
28 |
add_action( 'wp', array( self::$instance, 'hooks' ) );
|
29 |
}
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
return self::$instance;
|
32 |
}
|
33 |
|
@@ -46,6 +59,25 @@ class HFE_Astra_Compat {
|
|
46 |
add_action( 'astra_footer', 'hfe_render_footer' );
|
47 |
}
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
/**
|
@@ -62,6 +94,70 @@ class HFE_Astra_Compat {
|
|
62 |
remove_action( 'astra_footer', 'astra_footer_markup' );
|
63 |
}
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
HFE_Astra_Compat::instance();
|
17 |
*/
|
18 |
private static $instance;
|
19 |
|
20 |
+
/**
|
21 |
+
* Instance of Elementor Frontend class.
|
22 |
+
*
|
23 |
+
* @var \Elementor\Frontend()
|
24 |
+
*/
|
25 |
+
private static $elementor_instance;
|
26 |
+
|
27 |
/**
|
28 |
* Initiator
|
29 |
*/
|
35 |
add_action( 'wp', array( self::$instance, 'hooks' ) );
|
36 |
}
|
37 |
|
38 |
+
if ( defined( 'ELEMENTOR_VERSION' ) && is_callable( 'Elementor\Plugin::instance' ) ) {
|
39 |
+
|
40 |
+
self::$elementor_instance = Elementor\Plugin::instance();
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
return self::$instance;
|
45 |
}
|
46 |
|
59 |
add_action( 'astra_footer', 'hfe_render_footer' );
|
60 |
}
|
61 |
|
62 |
+
if ( $this->is_before_footer_enabled() ) {
|
63 |
+
|
64 |
+
// Action `elementor/page_templates/canvas/after_content` is introduced in Elementor Version 1.9.0.
|
65 |
+
if ( version_compare( ELEMENTOR_VERSION, '1.9.0', '>=' ) ) {
|
66 |
+
|
67 |
+
// check if current page template is Elemenntor Canvas.
|
68 |
+
if ( 'elementor_canvas' == get_page_template_slug() ) {
|
69 |
+
|
70 |
+
$override_cannvas_template = get_post_meta( $this->get_hfe_before_footer_id(), 'display-on-canvas-template', true );
|
71 |
+
|
72 |
+
if ( '1' == $override_cannvas_template ) {
|
73 |
+
add_action( 'elementor/page_templates/canvas/after_content', array( $this, 'render_before_footer' ), 9 );
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
add_action( 'astra_footer_before', array( $this, 'render_before_footer' ) );
|
79 |
+
|
80 |
+
}
|
81 |
}
|
82 |
|
83 |
/**
|
94 |
remove_action( 'astra_footer', 'astra_footer_markup' );
|
95 |
}
|
96 |
|
97 |
+
/**
|
98 |
+
* Get HFE Before Footer ID
|
99 |
+
*
|
100 |
+
* @since 1.0.2
|
101 |
+
* @return (String|boolean) before gooter id if it is set else returns false.
|
102 |
+
*/
|
103 |
+
function get_hfe_before_footer_id() {
|
104 |
+
|
105 |
+
$before_footer_id = Header_Footer_Elementor::get_settings( 'type_before_footer', '' );
|
106 |
+
|
107 |
+
if ( '' === $before_footer_id ) {
|
108 |
+
$before_footer_id = false;
|
109 |
+
}
|
110 |
+
|
111 |
+
return apply_filters( 'get_hfe_before_footer_id', $before_footer_id );
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Checks if Before Footer is enabled from HFE.
|
116 |
+
*
|
117 |
+
* @since 1.0.2
|
118 |
+
* @return bool True if before footer is enabled. False if before footer is not enabled.
|
119 |
+
*/
|
120 |
+
function is_before_footer_enabled() {
|
121 |
+
|
122 |
+
$before_footer_id = Header_Footer_Elementor::get_settings( 'type_before_footer', '' );
|
123 |
+
$status = false;
|
124 |
+
|
125 |
+
if ( '' !== $before_footer_id ) {
|
126 |
+
$status = true;
|
127 |
+
}
|
128 |
+
|
129 |
+
return apply_filters( 'hfe_before_footer_enabled', $status );
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Display before footer markup.
|
134 |
+
*
|
135 |
+
* @since 1.0.2
|
136 |
+
*/
|
137 |
+
public function render_before_footer() {
|
138 |
+
|
139 |
+
if ( false == apply_filters( 'enable_hfe_render_before_footer', true ) ) {
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
|
143 |
+
?>
|
144 |
+
<div class="hfe-before-footer-wrap">
|
145 |
+
<?php $this->get_before_footer_content(); ?>
|
146 |
+
</div>
|
147 |
+
<?php
|
148 |
+
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Prints the Before Footer content.
|
153 |
+
*/
|
154 |
+
public function get_before_footer_content() {
|
155 |
+
|
156 |
+
echo "<div class='footer-width-fixer'>";
|
157 |
+
echo self::$elementor_instance->frontend->get_builder_content_for_display( $this->get_hfe_before_footer_id() );
|
158 |
+
echo '</div>';
|
159 |
+
}
|
160 |
+
|
161 |
}
|
162 |
|
163 |
HFE_Astra_Compat::instance();
|