[wp-trac] [WordPress Trac] #35772: add_settings_section and add_settings_field callback param should be of 'callable' type

WordPress Trac noreply at wordpress.org
Mon Feb 8 04:45:23 UTC 2016


#35772: add_settings_section and add_settings_field callback param should be of
'callable' type
----------------------------+-----------------------------
 Reporter:  aidanlane       |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 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 [ticket: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

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35772>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list