Opened 14 years ago
Closed 14 years ago
#13957 closed defect (bug) (wontfix)
Check for $wp_rewrite in register_taxonomy and register_post_type
Reported by: | nacin | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: |
Description
I'm noticing some people report errors like this:
Fatal error: Call to a member function add_rewrite_tag() on a non-object in /wp-includes/taxonomy.php on line 289
This plugin didn't work right in 2.9, but in 2.9 we checked $wp_rewrite for !empty() in register_taxonomy before calling add_rewrite_tag().
I suggest we add back those sanity checks.
Attachments (1)
Change History (6)
#3
@
14 years ago
Probably. That's actually why I recall I didn't raise this before.
I see that as fine for register_post_type(), but perhaps register_taxonomy() should be restored to its old state? We're breaking a lot of plugins I imagine.
Note: See
TracTickets for help on using
tickets.
Since this is an issue of plugin or theme developers calling
register_taxonomy
at the wrong point, isn't it better to throw the fatal error to warn them away from it, rather than failing silently?