[wp-trac] [WordPress Trac] #20465: Change name of global for wp_customize instance

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 17 17:33:00 UTC 2012


#20465: Change name of global for wp_customize instance
-------------------------+------------------
 Reporter:  mattonomics  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.4
Component:  Themes       |     Version:  3.4
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------

Comment (by scribu):

 Since there can only ever be one instance, you can do it just as well with
 a static method:

 {{{
 add_action( 'customize_register', array( __CLASS__, 'register_controls' )
 );
 }}}

 And to unhook it from a plugin, instead of:

 {{{
 add_action( 'customize_register', array( WP_Customize::$instance,
 'register_controls' ) );
 }}}

 you could do:

 {{{
 add_action( 'customize_register', array( 'WP_Customize',
 'register_controls' ) );
 }}}

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


More information about the wp-trac mailing list