Skip to content

Commit

Permalink
suppress warnings for HTML5 elements
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Oct 5, 2021
1 parent d5afbd0 commit 21c1ed4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blockbase/inc/social-navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ function get_social_menu_as_social_links_block() {

function append_social_links_block_to_primary_navigation( $primary_navigation, $social_links_block ) {
$dom = new domDocument;
// Since the nav block uses HTML5 element names, we need to suppress the warnings it sends when we loadHTML with HTML5 elements.
libxml_use_internal_errors( true );
$dom->loadHTML( $primary_navigation );
$wp_block_navigation__container = $dom->getElementsByTagName('ul')->item( 0 );
$social_links_node = $dom->createDocumentFragment();
Expand Down

0 comments on commit 21c1ed4

Please sign in to comment.