[wp-trac] [WordPress Trac] #33440: Deprecated PHP4 style constructor warnings make debugging hard

WordPress Trac noreply at wordpress.org
Thu Aug 20 19:08:02 UTC 2015


#33440: Deprecated PHP4 style constructor warnings make debugging hard
------------------------------------------------+--------------------------
 Reporter:  McGuive7                            |       Owner:
     Type:  enhancement                         |      Status:  new
 Priority:  normal                              |   Milestone:  Awaiting
Component:  Widgets                             |  Review
 Severity:  normal                              |     Version:  4.3
 Keywords:  has-patch 2nd-opinion dev-feedback  |  Resolution:
                                                |     Focuses:
------------------------------------------------+--------------------------

Comment (by McGuive7):

 What about something like this:

 {{{
 public function WP_Widget( $id_base, $name, $widget_options = array(),
 $control_options = array() ) {
         $class = 'WP_Widget';
         if ( $class != get_class( $this ) ) {
                 $class .= ' (' . get_class( $this ) . ')';
         }

         _deprecated_constructor( $class, '4.3.0' );
         WP_Widget::__construct( $id_base, $name, $widget_options,
 $control_options );
 }
 }}}

 We could even prepend some text so the whole thing looks like "...
 WP_Widget (extended by {widget_class)", however I figure it might be
 better to keep it simple and avoid creating new translations (no idea if
 that's a big deal or not).

 Thoughts?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33440#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list