Quantcast
Channel: Topic Tag: plugin | WordPress.org
Viewing all articles
Browse latest Browse all 26892

bcworkz on "custom taxonomy headaches"

$
0
0

When you click for the answer key, you are reinitializing the entire WP environment, so something different is happening this time around as opposed to the last time around. All your init hooks are priority 0. The order beyond that is not documented, but it appears to be alphabetical. Which should work fine in your case. But if for some reason it were anti-alphabetical, you will be assigning a taxonomy to a non-existing-at-the-time custom post type, causing an unflagged failure.

I'm not confident at all this is the problem, but it's easy enough to try. Try assigning the taxonomy calls a higher priority number so they execute later than the custom post type calls. I personally don't like low priority numbers, I typically see no advantage to early execution. I'd rather my hooks execute last to avoid other hooks walking over mine. And if my hook gets blocked out by an earlier bad hook, it's fairly easy to find the offender. On that note, disable all plugins to ensure a clean playing field. Even try swapping themes to eliminate that potential conflict.

Otherwise, keep debugging. See what the global $wp_taxonomies contains after the answer key click. Trace into core code if you have to. I know how easy it is to write it off as a WP bug in frustration, but I think you know how unlikely that really is. Even if it were a bug, you'd have to trace it to it's actual occurrence in order to reliably have others replicate it, so one way or the other, you need to do more debugging. Good luck.


Viewing all articles
Browse latest Browse all 26892

Trending Articles