Skip to content

Commit

Permalink
Merge pull request #86 from mahajanleena1995/change-render-function
Browse files Browse the repository at this point in the history
Fix: Layout CSS/JS not rendering in some cases
  • Loading branch information
vrundakansara authored May 26, 2020
2 parents ab918da + 4e29141 commit 2144df0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Donate link:** https://www.paypal.me/BrainstormForce
**Requires at least:** 3.6
**Tested up to:** 5.4
**Stable tag:** 1.1.8
**Stable tag:** 1.1.9
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##

### 1.1.9 ###
- Fix: Layout CSS/JS not rendering in some cases

### 1.1.8 ###
- Fix: Load CSS/JS of Header and Footer in `<header>` fixing flash of unstyled content.

Expand Down
4 changes: 2 additions & 2 deletions bb-header-footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://www.brainstormforce.com/
* Text Domain: bb-header-footer
* Domain Path: /languages
* Version: 1.1.8
* Version: 1.1.9
*
* @package BB_Header_Footer
*/
Expand All @@ -17,7 +17,7 @@
*/
require_once 'class-bb-header-footer.php';

define( 'BBHF_VER', '1.1.8' );
define( 'BBHF_VER', '1.1.9' );
define( 'BBHF_DIR', plugin_dir_path( __FILE__ ) );
define( 'BBHF_URL', plugins_url( '/', __FILE__ ) );
define( 'BBHF_PATH', plugin_basename( __FILE__ ) );
Expand Down
32 changes: 24 additions & 8 deletions class-bb-header-footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public static function get_header_content() {
echo '<div class="bhf-fixed-header">';
}

echo self::render_bb_layout( $header_id );
echo self::render_bb_layout( $header_id, 'header' );

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

$footer_id = BB_Header_Footer::get_settings( 'bb_footer_id', '' );
echo "<div class='footer-width-fixer'>";
echo self::render_bb_layout( $footer_id );
echo self::render_bb_layout( $footer_id, 'footer' );
echo '</div>';
}

Expand All @@ -210,14 +210,30 @@ public static function get_footer_content() {
* @since 1.1.6
*
* @param String $post_id post of which is to be rendered.
* @param String $data_type data-type of which is to be rendered.
*
* @return String Rendered markup of the layout
*/
public static function render_bb_layout( $post_id ) {
return FLBuilderShortcodes::insert_layout(
array(
'id' => $post_id,
)
public static function render_bb_layout( $post_id, $data_type ) {

$data_array = array(
'itemscope' => 'itemscope',
'data-type' => $data_type,
);

switch ( $data_type ) {
case 'header':
$data_array['itemtype'] = 'http://schema.org/WPHeader';
break;
case 'footer':
$data_array['itemtype'] = 'http://schema.org/WPFooter';
break;
}

return FLBuilder::render_content_by_id(
$post_id,
'div',
$data_array
);
}

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

}
}
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: header footer for beaver builder, beaver builder modules, customize header
Donate link: https://www.paypal.me/BrainstormForce
Requires at least: 3.6
Tested up to: 5.4
Stable tag: 1.1.8
Stable tag: 1.1.9
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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

== Changelog ==

= 1.1.9 =
- Fix: Layout CSS/JS not rendering in some cases

= 1.1.8 =
- Fix: Load CSS/JS of Header and Footer in `<header>` fixing flash of unstyled content.

Expand Down

0 comments on commit 2144df0

Please sign in to comment.