wp_nav_menu crashing in PHP 8.2 with custom taxomy
-
My theme is calling wp_nav_menu() without parameters. When using custom post types with custom taxonomy, it crashes in /wp-includes/nav-menu-template.php on line 353. After a bit of debugging, this line:
$terms = wp_get_object_terms( $queried_object_id, $taxonomy, array( ‘fields’ => ‘ids’ ) );
is returning an array of WP_Term objects instead of an array of numeric ids.
I am not sure how to fix the source of the problem, but I worked around it by modifying nav-menu-template.php to check if the type returned is object and get the term_id from the object instead. It is not a good solution and it will stop working probably the next time WordPress updates.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘wp_nav_menu crashing in PHP 8.2 with custom taxomy’ is closed to new replies.