#9704 closed enhancement (wontfix)
Make the Name of the Widget optional
Reported by: | hakre | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | 2.8 |
Component: | Widgets | Keywords: | has-patch |
Focuses: | Cc: |
Description
Per default a Widget should have the name of it's own class. That helps prototyping new Widgets because there is no need to over-ride the default Widgets Class constructor.
This established Documentation conform behavior as well because it is written:
* This class must be extended for each widget and WP_Widget::widget(), WP_Widget::update() * and WP_Widget::form() need to be over-ridden.
Without the patch the constructor function needs to be over-ridden as well. With the patch, the comment above is true then.
Attachments (2)
Change History (9)
#3
@
16 years ago
err. disregard that last remake. it would make more sense to make the id_base optional imo. but it's probably a bit too late now. there have been a few posts on the dev blog related to how to create wp widgets, and surely quite a few blogs have picked them up and parroted the stuff in it.
#4
follow-up:
↓ 6
@
16 years ago
- Priority changed from normal to low
- Severity changed from normal to minor
- Type changed from defect (bug) to enhancement
The important setting here is $id_base
as it's used for the name of option when the widget's data is saved as well as for the css classname and some other places.
The $name
is displayed to the user so it should be user friendly. We can make it optional with default = $id_base, but preferably all widgets should have proper names.
#6
in reply to:
↑ 4
@
16 years ago
- Milestone 2.8 deleted
- Resolution set to wontfix
- Status changed from new to closed
Replying to azaozz:
The
$name
is displayed to the user so it should be user friendly.
and thus translatable. closing as wontfix as a result.
#7
@
16 years ago
Yeah preferable, all _should_ (as you write) have propper names but must not. Same for translation.
Let's say you write a prototype widget and want to get it run fast. If the name is optional as well, you can fully skip to subclass the constructor. that easy it is.
so i see no problem at all with not having a super-propper name or no translations afterwards with it. it is just for rapid prototyping. what's the deal?
making $name optional by defaulting to the class'es name.