[wp-trac] [WordPress Trac] #56127: WP_Widget contructor throws fatal ArgumentCountError in WordPress 6.0 running on PHP 8

WordPress Trac noreply at wordpress.org
Fri Jul 1 18:48:40 UTC 2022


#56127: WP_Widget contructor throws fatal ArgumentCountError in WordPress 6.0
running on PHP 8
------------------------------------------------+--------------------------
 Reporter:  firefly2000                         |       Owner:  (none)
     Type:  defect (bug)                        |      Status:  new
 Priority:  normal                              |   Milestone:  Awaiting
                                                |  Review
Component:  Widgets                             |     Version:  6.0
 Severity:  normal                              |  Resolution:
 Keywords:  needs-patch reporter-feedback php8  |     Focuses:  coding-
                                                |  standards
------------------------------------------------+--------------------------
Changes (by TimothyBlynJacobs):

 * keywords:  needs-patch => needs-patch reporter-feedback php8
 * severity:  blocker => normal


Comment:

 Hi @firefly2000,

 Welcome to Trac!

 Can you share the widgets you are having trouble with? Widgets are
 supposed to define their own constructor without any parameters, or pass
 an instance of their widget to `register_widget` instead of a class name.

 https://developer.wordpress.org/themes/functionality/widgets/

 So while this is now a fatal error in PHP 8, it sounds to me like the
 widget was already behaving incorrectly.

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


More information about the wp-trac mailing list