#35772 closed defect (bug) (fixed)
add_settings_section and add_settings_field callback param should be of 'callable' type
Reported by: | aidanlane | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
Currently the type is string
, which is inaccurate and will be flagged as such by tools such as Scrutinizer (https://scrutinizer-ci.com/).
add_settings_section
:
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/template.php#L1191
add_settings_field
:
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/template.php#L1229
callable
is the type is used by add_action
(https://developer.wordpress.org/reference/functions/add_action/), add_filter
(https://developer.wordpress.org/reference/functions/add_filter` and by many other functions already 34032.
Refs:
http://uk1.php.net/manual/en/language.types.callable.php
https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md#keyword
http://www.phpdoc.org/docs/latest/guides/types.html
Hi @aidanlane, nice catch and thanks for the patch!