Closed mtekk closed 3 years ago
It looks like the proper solution is to divide the function into one handling post types and another for taxonomy terms. Should be able to get rid of a branch statement by doing this as at the point of being called we already know if we have a post type or taxonomy. Since the real solution is to divide this function, this is being punted to 6.5 as that is the next intercept for 'API' changes.
Punting to 7.0 (6.5 will not have API changes)
Part of this is going to remold do_archive_by_post_type()
, a la what happened to do_post()
a while back.
The last if/else if statement is a mess (too much stuff being checked in the condition). Need to split that state check to its own function, or some other organization to make it more readable.