diff --git a/wp/headless-wp/includes/classes/Links.php b/wp/headless-wp/includes/classes/Links.php index cad8af844..bd3b77576 100644 --- a/wp/headless-wp/includes/classes/Links.php +++ b/wp/headless-wp/includes/classes/Links.php @@ -64,6 +64,11 @@ public function create_taxonomy_rewrites( $rules ) { continue; } + // Skip if rewrite is not an array (could be false or not set) + if ( ! is_array( $taxonomy->rewrite ) || empty( $taxonomy->rewrite['slug'] ) ) { + continue; + } + $rewrite_slug = $taxonomy->rewrite['slug']; $rewrite_query_var = $taxonomy->query_var;