[wp-trac] [WordPress Trac] #16749: Hooks alter/break array-formatted callbacks

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 4 21:18:12 UTC 2011


#16749: Hooks alter/break array-formatted callbacks
--------------------------+-----------------------
 Reporter:  Veraxus       |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+-----------------------
Changes (by Veraxus):

 * status:  closed => reopened
 * resolution:  worksforme =>


Comment:

 No, I've confirmed the callback is being entered correctly.

 For instance, here's one of the problem hooks:

 {{{add_action('admin_init', array('CTXPS_App','admin_init'));}}}

 Now if I write it like this, it works (but requires PHP 5.2.3)...

 {{{add_action('admin_init', 'CTXPS_App::admin_init');}}}

 Written as an array, I get this...

 Warning: call_user_func_array() [function.call-user-func-array]: First
 argument is expected to be a valid callback, '' was given in
 /var/www/vhosts/contextureintl.com/subdomains/plugintest/httpdocs/wp-
 includes/plugin.php on line 488

 If I print_r($the_['function']) everywhere it appears in plugin.php, I see
 that the array now looks like this...

 {{{array('CTXPS_App','admin_init',1)}}}

 So far I just haven't been able to figure out where that 1 is coming from.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16749#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list