Skip to content

Commit a119034

Browse files
changed �insert_layout function to render_content_by_id
1 parent ab918da commit a119034

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

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+
}

0 commit comments

Comments
 (0)