[wp-trac] [WordPress Trac] #28672: add_settings_field & co don't return values
WordPress Trac
noreply at wordpress.org
Fri Aug 28 08:58:53 UTC 2015
#28672: add_settings_field & co don't return values
----------------------------------------+------------------------------
Reporter: TJNowell | Owner: GunGeekATX
Type: enhancement | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: Options, Meta APIs | Version: 2.7
Severity: normal | Resolution:
Keywords: needs-unit-tests has-patch | Focuses: administration
----------------------------------------+------------------------------
Changes (by obenland):
* keywords: needs-unit-tests good-first-bug has-patch => needs-unit-tests
has-patch
Comment:
As @GunGeekATX pointed out earlier, `add_settings_section()` is designed
to register both `$page` and `$section`. The way core just calls
`do_settings_section()` without registering its sections first suggests
that this is very much the way the API is designed, and it would also
apply to `add_settings_field()`.
If we decide to be stricter in that regard and require registering
sections before being able to add fields to it, rather than accounting for
core's oddity here we should register core's sections before we call
`do_settings_section()` on them. In that case we'd also have to figure out
how to deal with the `'default'` section.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28672#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list