imoyano on "[Plugin: Page Builder by SiteOrigin] is_active_widget not working after plugin update"

ساخت وبلاگ

Hello,

I'm running WP 4.5.2 with some Widgets using PageBuilder. After I've updated the plugin to last version 2.4.9, my widgets stopped working.

The PHP error is:
Notice: Undefined index: mywidget_widget-4761001 in X:xampphtdocsWPpublicwp-includeswidgets.php on line 809

The following line is in the is_active_widget function:
if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] )

My widget has been using this function (is_active_widget), it was working before the plugin was updated.

https://wordpress.org/plugins/siteorigin-panels/

imoyano
Member
Posted 12 minutes ago #

Here the solution....

I was using this code to register my widget:

add_action( 'widgets_init', function() {
register_widget( 'mywidget' );
});

I've changed to this:

add_action( 'init', function() {
register_widget( 'mywidget' );
});

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 239 تاريخ : پنجشنبه 27 خرداد 1395 ساعت: 12:41