Support » Plugin: Widget Classes » [Plugin: Widget Classes] Fatal Error

  • dsburdette


    With this plugin installed, I constantly get the following error:

    Fatal error: Call to undefined method widget_context::get_option() in /Users/dsburdette/Sites/thinkgiftworks/wp-content/plugins/widget-classes/widget-classes.php on line 64

    Line 64 looks like this in the widget-classes.php file:

    $instance = $widget[‘callback’][0]->get_settings();

    It seems that get_settings() is deprecated and get_option() should be used instead but if I switch that out, no luck either. I’m not a coder so I’m sure it’s not as simple as that but I tried nonetheless.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same error here. Anyone have a workaround for this please?

    Plugin Author aizatto


    I am the developer of this plugin. Could you please tell me how to reproduce this?

    Which theme are you using?
    Are you using it with a unique widget?

    I’m developing from the Starkers theme (parent) to my child theme. Please note that I’ve tested this with no other plug-ins installed. The widget I’ve tried it on was a simple Text Widget containing a contact address and that’s all.

    Thanks for following up aizatto. I’m testing with the twentyten theme.

    When using this plugin with the Widget Context plugin, I get fatal errors. I can’t really complain too much here, because the above plugin is only tested with 2.9.2 so I tried using Widget Logic instead. There are no fatal errors when using Widget Logic, however the classes plugin has no effect on the markup.

    There appears to be a common conflict with any sidebar plugins performing an interception to the widget UI.



    @aizatto – this is a really great plugin when it works and is very useful since there isn’t another easy way to add CSS to a specific plugin instance.

    However the problem is the conflict with other Widget plugins or themes that use the sidebar hook. Widget Cache for example will conflict, as well as many others listed on the forums. It seems to be the get_settings() line (#64) is causing the problem – would be great to see a fix!



    @aizatto – I dug a little more into this, and I found a workaround but it’s not scalable 🙂

    The issue is that other Widget plugins (like ) register their own callbacks, so that $widget[‘callback’][0] (the line that executes get_settings) is no longer a _Widget object – hence the fatal error.

    By dumping out the whole $widget (after another Widget plugin is installed) I saw that what had been $widget[‘callback’] became [‘callback_wc_redirect’] – and so changing that in your plugin code allowed it to play happily with Widget Cache.

    My concern is that other Widget plugins would alter the array key differently, and so a better parsing test is needed. Perhaps your plugin can scan the $widget object, look for the correct array key by property, then apply the get_settings() to it.

    Hope this helps some people!



    I ended up needing to refine this to work with multiple other Widget plugins (Widget Logic and Widget Cache specifically)

    Code below I inserted at line#55 of the widget-classes.php plugin file.

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Widget Classes] Fatal Error’ is closed to new replies.