The called constructor method for WP_Widget is deprecated since version 4.3.0

前端 未结 6 602
一生所求
一生所求 2020-12-13 13:28

I just updated to WordPress 4.3 and it seems that something is broken.

I get this error that shows up on my page:

Notice: The called construct

6条回答
  •  自闭症患者
    2020-12-13 14:22

    Declaring a function then calling the parent constructor resolved this issue for me.

    class myClass extends WP_Widget {
      function __construct(){
         parent::__construct(...) // calls constructor from WP_Widget class
      }
    }
    

提交回复
热议问题