Opened 15 years ago
Closed 15 years ago
#10051 closed enhancement (invalid)
More flexible register_widget()
Reported by: | scribu | Owned by: | azaozz |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.8 |
Component: | Widgets | Keywords: | needs-patch |
Focuses: | Cc: |
Description
The way widgets are currently registered don't allow you to pass arguments to the constructor.
This is a possible solution that is backwards compatible.
Attachments (1)
Change History (7)
#1
@
15 years ago
- Keywords needs-testing removed
- Summary changed from register_widget() should accept an object as the parameter to More flexible register_widget()
- Type changed from defect (bug) to enhancement
I realize now that this goes against the whole ideea of the Factory pattern. Will think of a better solution.
#2
@
15 years ago
- Component changed from General to Widgets
- Keywords reporter-feedback added; dev-feedback removed
- Owner set to azaozz
What kind of argument do you need to pass? I've rewritten quite a few widget-related plugins myself in the past three weeks, and I've probably found your needed workaround.
#4
@
15 years ago
- Keywords reporter-feedback removed
I needed to pass the textdomain, but I realized that I can use a constant for that. Anyway, I would like to know your workaround.
Note: See
TracTickets for help on using
tickets.
Modifies WP_Widget_Factory::register() to allow object as the parameter