Fatal error: Uncaught TypeError implode()
-
Don’t know if this might be a bug of wordpress or I do somthing wrong. I have created a standard theme. Works well so far. When it comes to adding a menu through a sidebar I get this warning.
Fatal error: Uncaught TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in /[path]/wp-includes/class-walker-nav-menu.php:158
Environment:
WP 6.2
PHP: 8.0In order to get rid the warning I have change the line 158 in the class-walker-nav-menu.php:158 as shown below.
// $class_names = implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $menu_item, $args, $depth ) ); $class_names = ''; $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';What I did to achive rendering a menu in the footer:
I have registered a sidebarregister_sidebar( array( 'name' => esc_html__( 'Anywear Footer About', 'anywear'), 'id' => 'anywear-footer-about', 'class' => 'anywear-footer-about', 'description' => 'AnyWear Dynamic Footer About Area', 'before_widget' => '<section id="%1$s" class="anywear-footer-about-widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="anywear-footer-about-widget-title">', 'after_title' => '</h2>' ) );created the related sidebar.php
if (!is_active_sidebar('anywear-footer-about')){ return; } else { dynamic_sidebar('anywear-footer-about'); }added the sidbar to the footer.php
<?php get_sidebar('anywear-footer-about');?>The page I need help with: [log in to see the link]
The topic ‘Fatal error: Uncaught TypeError implode()’ is closed to new replies.