constructor method for WP_Widget in WPPortfolioWidget is deprecated
-
Hi,
If debug is enabled, I get the following message in the site;Notice: The called constructor method for WP_Widget in WPPortfolioWidget is deprecated since version 4.3.0! Use
__construct()
instead. in /var/www/romfordmakerspace/wp-includes/functions.php on line 3767Obviously I can get rid of it by disabling debug messages into the site, but this patch seems to fix it;
--- lib/widget.inc.php 2016-10-10 18:03:44.738470380 +0000 +++ lib/widget.inc.php_bak 2016-10-10 18:01:07.340470441 +0000 @@ -17,7 +17,7 @@ $control_ops = array( 'width' => 500, 'height' => 40, 'id_base' => 'wp-portfolio-widget' ); /* Create the widget. */ - parent::__construct( 'wp-portfolio-widget', 'WP Portfolio Widget', $widget_ops, $control_ops ); + $this->WP_Widget( 'wp-portfolio-widget', 'WP Portfolio Widget', $widget_ops, $control_ops ); } /** @@ -180,4 +180,4 @@ add_action('widgets_init', create_function('', 'return register_widget("WPPortfolioWidget");')); -?> +?>
based on the comment here;
https://www.ads-software.com/support/topic/notice-wp_widget-is-deprecated-since-version-430/?replies=27#post-7532119
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘constructor method for WP_Widget in WPPortfolioWidget is deprecated’ is closed to new replies.