Opened 15 years ago
Closed 15 years ago
#19809 closed defect (bug) (invalid)
can't pass an array(class, method) as a callback in add_settings_field()
| Reported by: | mati1000 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 3.3.1 |
| Severity: | normal | Keywords: | close |
| Cc: | Focuses: |
Description
I want to pass an array(class, method) as a callback for a settings field:
add_settings_field($field, $label, array(&$this, $method) , $slug, $section, $field);
But 'do_settings_sections' don't do a check like 'add_filter()' and it's used as string with 'call_user_func' in wp-admin/includes/template.php:1103
Change History (5)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The PHP error is:
Warning: call_user_func() [function.call-user-func]: First argument is expected to be a valid callback in /wp-admin/includes/template.php on line 1102