#4961 closed defect (bug) (wontfix)
multiple wp_dropdown_categories broken
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.2.3 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
Writing a complex template management panel, I've found that is impossibile to use multiple wp_dropdown_categories because of a function called stamp_cat() , that is located inside &get_categories() and re-instanziated every dropdown request. This produce errors like:
Fatal error: Cannot redeclare stamp_cat() (previously declared in /Users/gomez/Sites/wpmu/wp-includes/category.php:99) in /Users/gomez/Sites/wpmu/wp-includes/category.php on line 99
I moved stamp_cat outside &get_categories, and it works for me. I've also made a patch for that, but I'm not sure if this can have some downside in other areas (maybe there's a reason for stamp_cat to be there, and I simply can't know it).
Bug first reported on <a href="http://trac.mu.wordpress.org/ticket/420">WPMU Trac</a>, and bounced back here because is a shared issue.
Attachments (2)
Change History (8)
#1
@
18 years ago
- Milestone changed from 2.4 (next) to 2.3
- Owner changed from anonymous to westi
- Status changed from new to assigned
- Version set to 2.2.3
Hmm.
-1 to globalising stamp_cat unless it is really needed elsewhere.
It looks like stamp_cat should be a lambda function really using create_function
#2
follow-up:
↓ 3
@
18 years ago
Can you explain me why? I can't understand it, and I just want to learn about it.
The patches I've submitted are just a shared working hack for my project, because I need to make it work *now*, but I can't understand what kind of issue may be caused by globalizing that function.
#3
in reply to:
↑ 2
@
18 years ago
- Milestone changed from 2.3 to 2.2.3
Replying to pixline:
Can you explain me why? I can't understand it, and I just want to learn about it.
The patches I've submitted are just a shared working hack for my project, because I need to make it work *now*, but I can't understand what kind of issue may be caused by globalizing that function.
There is not a specific issue with globalising the function.
The reason for using create_function is the function has a very specific purpose - to be passed to array_map and so using create_function is cleaner IMHO.
Removing from the 2.3 milestone as this code no longer exists in 2.3
patch for category.php against WP 223