From 21c1ed488802942351edfa6a8d989d0d3e48da8a Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Tue, 5 Oct 2021 12:41:01 +0100 Subject: [PATCH] suppress warnings for HTML5 elements --- blockbase/inc/social-navigation.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blockbase/inc/social-navigation.php b/blockbase/inc/social-navigation.php index ac5bd6ea32..a4be60a410 100644 --- a/blockbase/inc/social-navigation.php +++ b/blockbase/inc/social-navigation.php @@ -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();