PHP error
-
Hi I don’t think the plugin is completely updated to be fully compatible with 4.3.1 as I still notice the error:
Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in \wp-includes\functions.php on line 3457Any thoughts?
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
-
Same problem for me, with the added burden that this deprecation warning is breaking the AJAX functionality of my plugin if WP_DEBUG is set to TRUE
This is the fix
class ujic_Widget extends WP_Widget { protected $plugin_slug = 'uji-countdown'; /** * Uji Countdown Init * * @since 2.0 * * @var string */ // public function ujic_Widget() { // <--- Replace this... public function __construct() { // <--- with this, and... $widget_ops = array( 'classname' => 'uji_Widget', 'description' => 'Uji Countdown widget.' ); // $this->WP_Widget( 'uji_Widget', 'Uji Countdown', $widget_ops ); // <--- this... parent::__construct( 'uji_Widget', 'Uji Countdown', $widget_ops ); // <--- with this. //actions add_action( 'plugins_loaded', array( &$this, 'load_textdomain' ) ); add_action( 'admin_enqueue_scripts', array( &$this, 'admin_widgets_scripts_styles' ) ); }Thanks caraffande,
Only when use PHP7+
It will be fixed in the next update.
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘PHP error’ is closed to new replies.