Skip to content

Commit 2144df0

Browse files
Merge pull request #86 from mahajanleena1995/change-render-function
Fix: Layout CSS/JS not rendering in some cases
2 parents ab918da + 4e29141 commit 2144df0

File tree

4 files changed

+34
-12
lines changed

4 files changed

+34
-12
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
**Donate link:** https://www.paypal.me/BrainstormForce
55
**Requires at least:** 3.6
66
**Tested up to:** 5.4
7-
**Stable tag:** 1.1.8
7+
**Stable tag:** 1.1.9
88
**License:** GPLv2 or later
99
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -93,6 +93,9 @@ href=”https://www.brainstormforce.com/go/brainstorm-force-twitter-page/?utm_so
9393

9494
## Changelog ##
9595

96+
### 1.1.9 ###
97+
- Fix: Layout CSS/JS not rendering in some cases
98+
9699
### 1.1.8 ###
97100
- Fix: Load CSS/JS of Header and Footer in `<header>` fixing flash of unstyled content.
98101

bb-header-footer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Author URI: https://www.brainstormforce.com/
88
* Text Domain: bb-header-footer
99
* Domain Path: /languages
10-
* Version: 1.1.8
10+
* Version: 1.1.9
1111
*
1212
* @package BB_Header_Footer
1313
*/
@@ -17,7 +17,7 @@
1717
*/
1818
require_once 'class-bb-header-footer.php';
1919

20-
define( 'BBHF_VER', '1.1.8' );
20+
define( 'BBHF_VER', '1.1.9' );
2121
define( 'BBHF_DIR', plugin_dir_path( __FILE__ ) );
2222
define( 'BBHF_URL', plugins_url( '/', __FILE__ ) );
2323
define( 'BBHF_PATH', plugin_basename( __FILE__ ) );

class-bb-header-footer.php

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public static function get_header_content() {
183183
echo '<div class="bhf-fixed-header">';
184184
}
185185

186-
echo self::render_bb_layout( $header_id );
186+
echo self::render_bb_layout( $header_id, 'header' );
187187

188188
if ( 'on' == $bb_sticky_header ) {
189189
echo '</div>';
@@ -198,7 +198,7 @@ public static function get_footer_content() {
198198

199199
$footer_id = BB_Header_Footer::get_settings( 'bb_footer_id', '' );
200200
echo "<div class='footer-width-fixer'>";
201-
echo self::render_bb_layout( $footer_id );
201+
echo self::render_bb_layout( $footer_id, 'footer' );
202202
echo '</div>';
203203
}
204204

@@ -210,14 +210,30 @@ public static function get_footer_content() {
210210
* @since 1.1.6
211211
*
212212
* @param String $post_id post of which is to be rendered.
213+
* @param String $data_type data-type of which is to be rendered.
213214
*
214215
* @return String Rendered markup of the layout
215216
*/
216-
public static function render_bb_layout( $post_id ) {
217-
return FLBuilderShortcodes::insert_layout(
218-
array(
219-
'id' => $post_id,
220-
)
217+
public static function render_bb_layout( $post_id, $data_type ) {
218+
219+
$data_array = array(
220+
'itemscope' => 'itemscope',
221+
'data-type' => $data_type,
222+
);
223+
224+
switch ( $data_type ) {
225+
case 'header':
226+
$data_array['itemtype'] = 'http://schema.org/WPHeader';
227+
break;
228+
case 'footer':
229+
$data_array['itemtype'] = 'http://schema.org/WPFooter';
230+
break;
231+
}
232+
233+
return FLBuilder::render_content_by_id(
234+
$post_id,
235+
'div',
236+
$data_array
221237
);
222238
}
223239

@@ -265,4 +281,4 @@ public static function get_settings( $setting = '', $default = '' ) {
265281
return apply_filters( "bhf_setting_{$setting}", $value );
266282
}
267283

268-
}
284+
}

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: header footer for beaver builder, beaver builder modules, customize header
44
Donate link: https://www.paypal.me/BrainstormForce
55
Requires at least: 3.6
66
Tested up to: 5.4
7-
Stable tag: 1.1.8
7+
Stable tag: 1.1.9
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -95,6 +95,9 @@ href=”https://www.brainstormforce.com/go/brainstorm-force-twitter-page/?utm_so
9595

9696
== Changelog ==
9797

98+
= 1.1.9 =
99+
- Fix: Layout CSS/JS not rendering in some cases
100+
98101
= 1.1.8 =
99102
- Fix: Load CSS/JS of Header and Footer in `<header>` fixing flash of unstyled content.
100103

0 commit comments

Comments
 (0)