Skip to:

Opened 8 years ago

Last modified 7 years ago

#6754 new defect (bug)

`widget()` methods should be self-sufficient

Reported by: boonebgorges's profile boonebgorges Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Core Keywords: needs-patch good-first-bug


In order to work properly in the context of the Customizer, all widget() methods must be self-sufficient. That is, they should assume that the $instance array passed to the function may sometimes be empty. As such, each widget class should have a way of defining the default widget settings independent of the form() or instance() methods. A default_args() or default_settings() method seems like a reasonable technique.


Change History (2)

#1 @boonebgorges
8 years ago

In 10384:

Make sure that max_groups is always defined in group widget.

This prevents a notice from being shown when the widget is added in the

Props slaFFik.
See #6754.
Fixes #6747.

#2 @DJPaul
7 years ago

  • Component changed from API to Core
Note: See TracTickets for help on using tickets.