#3427 closed defect (bug) (invalid)
$category_cache format change (regression?)
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | highest omg bbq | |
Severity: | blocker | Version: | 2.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
In 2.0.x, $category_cache is an array of post_id arrays with category objects as the post_id array values.
Array (
'post_id' => array(category_object, category_object)
,'post_id' => array(category_object)
)
In 2.1 there seems to have been another layer of array added:
Array (
Array (
'post_id' => Array(category_object, category_object)
,'post_id' => Array(category_object)
)
)
I can't see the benefit of this extra layer, and it breaks backward compatibility.
If this is "broken" as I suspect, point me in the right direction and I'll try to create a patch.
Change History (7)
#3
@
18 years ago
- Milestone 2.1 deleted
- Resolution set to invalid
- Status changed from assigned to closed
Actually, yes, now that I look, there appears to be API for everything that's changed. I was thinking of the $comment_count_cache
which doesn't have an API, but hasn't changed.
Alex, unless you can come up with a case where the current API for these isn't sufficient (get_category(), get_post() etc and wp_cache_set()), I think this can be closed.
#4
@
18 years ago
Take a look at what I'm doing here:
http://dev.wp-plugins.org/browser/articles/trunk/articles.php?format=txt
Line 100-125 or so. I need to loop through the post/cat relationships. I'm trying to use the tools given to me by core, but making the plugin be 2.0.x and 2.1.x compatible is a bit tricky.
I'm not sure how the APIs help here. What would really help would be to have an array of categories as a property of each post, but I think I've rung that bell to death already. :)
Looks like that changed here: [4524], and it looks like it was intentional. I can't think of a clean way to fix backward compat (and keep this change) off the top of my head. We could have two cache vars (one for 1, one for non-1), but that's ugly.
'course, we're already breaking some backwards compat with 2.1, so better to break many things at once instead of a little at a time.
Ryan?