When outputting custom taxonomies in the sitemap, the get_terms() function was used, but it returned an "Invalid Taxonomy" error because the function was called before the taxonomy was registered.
Therefore, a new function was created that directly accesses the database and receives the necessary taxonomies.
When outputting custom taxonomies in the sitemap, the get_terms() function was used, but it returned an "Invalid Taxonomy" error because the function was called before the taxonomy was registered. Therefore, a new function was created that directly accesses the database and receives the necessary taxonomies.