New widget option after calling register_widget creating empty widget
|Reported by:||jimisaacs||Owned by:||azaozz|
After I register a new widget class that has never been registered before, navigate to the widgets.php admin page and allow the option to be created automatically. The option value looks like this as serialized data:
As you can see there is an empty widget in there for some reason. Basically the unserialized option value looks like the following as an array:
array( '2' => array(), _multiwidget => 1 );
This is odd behavior since the first multi number has always started at 2, but with that previous array in there it starts at 3, and randomly which is what irks me. i can't seem to find when it happens or a pattern, so naturally this feels like a bug.
As this does not seem to break anything with the core functionality of WordPress, I would say this is normal priority. What this does do is pose many questions for those of us that dive deep into the Widget API, where our plugins and the functionality of them are dependent on how these things work. My widget plugin is quite large, and I need to know if I can depend on the first multi number of a widget when the class is first registered.
If this is not a bug, and normal functionality, I apologize, and would like to ask for a heads up on the subject.
Change History (6)
- Keywords dev-feedback added; options defaults removed
- Milestone changed from 2.9.3 to 3.0