{"id":6755101,"date":"2015-11-16T21:09:51","date_gmt":"2015-11-16T21:09:51","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/constructor-method-error\/"},"modified":"2016-08-30T20:19:50","modified_gmt":"2016-08-30T20:19:50","slug":"constructor-method-error","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/constructor-method-error\/","title":{"rendered":"constructor method error"},"content":{"rendered":"<p>Activating DevDmBootstrap3 on WP 4.3.1 gives me this error:<br \/>\nNotice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use __construct()<\/p>\n<p>I fixed it by changing these lines in bootstrap-custom-menu-widget.php:<br \/>\n    function bootstrap_custom_menu() {<\/p>\n<p>        $widget_ops = array( &#8216;classname&#8217; =&gt; &#8216;bootstrapwidgetmenu&#8217;, &#8216;description&#8217; =&gt; __(&#8216;A custom menu widget that uses the wp_bootstrap_navwalker&#8217;, &#8216;devdmbootstrap3&#8217;));<\/p>\n<p>        $control_ops = array( &#8216;width&#8217; =&gt; 300, &#8216;height&#8217; =&gt; 350, &#8216;id_base&#8217; =&gt; &#8216;bootstrap-widget-menu&#8217;);<\/p>\n<p>        $this-&gt;WP_Widget( &#8216;bootstrap-widget-menu&#8217;, __(&#8216;Boot Strap Menu&#8217;, &#8216;devdmbootstrap3&#8217;), $widget_ops, $control_ops);<br \/>\n    }<\/p>\n<p>to this:<\/p>\n<p>    function __construct() {<br \/>\n        parent::__construct(<br \/>\n            &#8216;bootstrap-widget-menu&#8217;, \/\/ Base ID<br \/>\n            __(&#8216;Boot Strap Menu&#8217;, &#8216;devdmbootstrap3&#8217;), \/\/ Name<br \/>\n            array(&#8216;description&#8217; =&gt; __(&#8216;A custom menu widget that uses the wp_bootstrap_navwalker&#8217;, &#8216;devdmbootstrap3&#8217;), )<br \/>\n            );<br \/>\n     }<\/p>\n<p>      \/\/  $widget_ops = array( &#8216;classname&#8217; =&gt; &#8216;bootstrapwidgetmenu&#8217;, &#8216;description&#8217; =&gt; __(&#8216;A custom menu widget that uses the wp_bootstrap_navwalker&#8217;, &#8216;devdmbootstrap3&#8217;));<\/p>\n<p>      \/\/  $control_ops = array( &#8216;width&#8217; =&gt; 300, &#8216;height&#8217; =&gt; 350, &#8216;id_base&#8217; =&gt; &#8216;bootstrap-widget-menu&#8217;);<\/p>\n<p>      \/\/  $this-&gt;WP_Widget( &#8216;bootstrap-widget-menu&#8217;, __(&#8216;Boot Strap Menu&#8217;, &#8216;devdmbootstrap3&#8217;), $widget_ops, $control_ops);<br \/>\n   \/\/  }<\/p>\n<p>Thanks for a great theme!<\/p>\n","protected":false},"template":"","class_list":["post-6755101","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6755101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6755101\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6755101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}