Viewing 1 replies (of 1 total)
  • Fixing this is straightforward, but I don’t know if this plugin is still supported by its author. If you make the fix below, it will get overwritten by any updates. In smartyoutube.php, on lines 1418 to 1423 the following lcode is causing the warning (a deprecated way of defining the constructor and calling the parent class constructor):

    function SmartYouTube_Widget() {
    		$widget_ops = array( 'classname' => 'smart-youtube', 'description' => 'A widget which dispalys some video from Youtube.' );
    		$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'smart-youtube' );
    		$this->WP_Widget( 'smart-youtube', 'Smart Youtube', $widget_ops, $control_ops );
    	}

    This change fixes the issue:

    function __construct() {
       $widget_ops = array( 'classname' => 'smart-youtube', 'description' => 'A widget which dispalys some video from Youtube.' );
       $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'smart-youtube' );
       parent::__construct( 'smart-youtube', 'Smart Youtube', $widget_ops, $control_ops );
    }
Viewing 1 replies (of 1 total)
  • The topic ‘WP_Widget is deprecated since version 4.3.0’ is closed to new replies.