[wp-trac] [WordPress Trac] #23265: Canonical callback representation

WordPress Trac noreply at wordpress.org
Tue Jan 22 15:36:05 UTC 2013


#23265: Canonical callback representation
-------------------------+------------------------------
 Reporter:  scribu       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Plugins      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------
Description changed by scribu:

Old description:

> Since PHP 5.3, you have various ways of passing the same callback:
>
> {{{
> add_action( 'the_content', array( 'My_Plugin_Main_Class', 'the_content' )
> );
>
> add_action( 'the_content', 'My_Plugin_Main_Class::the_content' );
>
> add_action( 'the_content', '\\My_Plugin_Main_Class::the_content' );
> }}}
>
> Currently, you have to use the exact same syntax in `remove_action()`, or
> it won't work.
>
> It would be nice if `_wp_filter_build_unique_id()` converted all these
> variations to a canonical representation.

New description:

 Since PHP 5.3, you have various ways of passing the same callback:

 {{{
 add_filter( 'the_content', array( 'My_Plugin_Main_Class', 'the_content' )
 );

 add_filter( 'the_content', 'My_Plugin_Main_Class::the_content' );

 add_filter( 'the_content', '\\My_Plugin_Main_Class::the_content' );
 }}}

 Currently, you have to use the exact same syntax in `remove_action()`, or
 it won't work.

 It would be nice if `_wp_filter_build_unique_id()` converted all these
 variations to a canonical representation.

 Sprung out of #23259

--

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


More information about the wp-trac mailing list