Categories
Blog CMS Wordpress

WordPress : Muncul "Notice: WP_Widget is deprecated since version 4.3.0"

Ketika update wordpress muncul “Notice: WP_Widget is deprecated since version 4.3.0” lalu bagimana menghilangkan peringatan tersebut?

Notice: The called constructor method for WP_Widget in ... is deprecated since version 4.3.0! Use __construct() instead. in ...\wp-includes\functions.php on line 3891

Setelah saya telusuri ditemukan code :

$this->WP_Widget('karisma-recent-posts', __('Karisma Recent Posts ', $this->localization_domain), $widget_ops);

Solusinya adalah dengan mengganti $this->WP_Widget dengan parent::__construct seperti di bawah ini :

parent::__construct('karisma-recent-posts', __('Karisma Recent Posts ', $this->localization_domain), $widget_ops);

Selesai sudah silahkan coba reload/refresh halaman web dan peringatan tersebut akan hilang.

By amri

Seorang penulis blog yang suka meng-kode juga suka musik dan otomotif. Nah lho bingung kan wkwkwk

0 replies on “WordPress : Muncul "Notice: WP_Widget is deprecated since version 4.3.0"”

Leave a Reply

Your email address will not be published. Required fields are marked *