[wp-trac] [WordPress Trac] #22704: Automatic Core Updates

WordPress Trac noreply at wordpress.org
Sat Sep 28 14:42:03 UTC 2013


#22704: Automatic Core Updates
-----------------------------+-----------------------
 Reporter:  pento            |       Owner:  pento
     Type:  task (blessed)   |      Status:  assigned
 Priority:  normal           |   Milestone:  3.7
Component:  Upgrade/Install  |     Version:  3.5
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+-----------------------

Comment (by wonderboymusic):

 Your example would still produce strict errors/warnings if you used
 `$this` in the methods hooked with `__CLASS__`

 {{{
 class Burrito {
     static $instance;

     private function __construct() {
         add_action( 'init', array( $this, 'add_onions' ) );
     }

     public static function get_instance() {
         if ( ! self::$instance instanceof Burrito )
             self::$instance = new self;

         return self::$instance;
     }

     function add_onions() {
         // now I can use $this with no warnings
     }
 }

 // Burrito::get_instance() called somewhere

 }}}

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


More information about the wp-trac mailing list