Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Commit

Permalink
Fix fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Oct 12, 2021
1 parent 382025d commit 854f4b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions blockbase/inc/social-navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// We should only change the render of the navigtion block
// to social links in the following conditions.
function blockbase_condition_to_render_social_menu( $block ) {
function blockbase_condition_to_render_social_menu( $block_content, $block ) {
// The block should be a navigation block.
if ( 'core/navigation' !== $block['blockName'] ) {
return false;
Expand All @@ -28,6 +28,10 @@ function blockbase_condition_to_render_social_menu( $block ) {
return false;
}

if ( empty( $block_content ) ) {
return false;
}

return true;
}

Expand Down Expand Up @@ -67,7 +71,7 @@ function append_social_links_block_to_primary_navigation( $primary_navigation, $
}

function blockbase_social_menu_render( $block_content, $block ) {
if ( blockbase_condition_to_render_social_menu( $block ) ) {
if ( blockbase_condition_to_render_social_menu( $block_content, $block ) ) {
$social_links_block = get_social_menu_as_social_links_block( $block );

return append_social_links_block_to_primary_navigation( $block_content, $social_links_block );
Expand Down

0 comments on commit 854f4b3

Please sign in to comment.