Opened 13 years ago
Closed 13 years ago
#21630 closed defect (bug) (fixed)
Calling add_settings_section() without callback function throws notices
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.5 | Priority: | normal |
| Severity: | normal | Version: | 3.4.1 |
| Component: | Administration | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
Calling add_settings_section() without a callback function should be possible, since a lot of settings section don't need *anything* special between the <h3> tags and the input settings.
This patch aloows people to call without providing a custom function for that purpose.
Changind do_settings_section().
Attachments (1)
Change History (5)
#2
@
13 years ago
Although those functions can be used anywhere, in my opinion their purpose is to be used in the core mainly.
__return_false, __return_true, __return_zero and __return_empty_array are not so well-known, besides there are no codex entry for them...
If you can pass false to register_post_type *callbacks* and a lot of other functions why not here too? It's just to make things easier for developers.
#3
@
13 years ago
- Keywords commit added
- Milestone changed from Awaiting Review to 3.5
The __return methods are designed for plugin usage, in particular as callbacks. Mainly for actions and filters, but this works too.
I usually pass __return_false here as well, but I also find it to be lame, and agree with this patch.
One might as well just pass
'__return_false'.