Title: [Plugin: Widget Classes] Fatal Error
Last modified: August 19, 2016

---

# [Plugin: Widget Classes] Fatal Error

 *  [dsburdette](https://wordpress.org/support/users/dsburdette/)
 * (@dsburdette)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-widget-classes-fatal-error/)
 * 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)

 *  [simplethemes](https://wordpress.org/support/users/simplethemes/)
 * (@simplethemes)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-widget-classes-fatal-error/#post-1772164)
 * Same error here. Anyone have a workaround for this please?
 *  Plugin Author [aizatto](https://wordpress.org/support/users/aizatto/)
 * (@aizatto)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-widget-classes-fatal-error/#post-1772168)
 * 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?
 *  Thread Starter [dsburdette](https://wordpress.org/support/users/dsburdette/)
 * (@dsburdette)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-widget-classes-fatal-error/#post-1772169)
 * 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.
 *  [simplethemes](https://wordpress.org/support/users/simplethemes/)
 * (@simplethemes)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-widget-classes-fatal-error/#post-1772170)
 * Thanks for following up aizatto. I’m testing with the twentyten theme.
 * Discoveries:
    When using this plugin with the [Widget Context](http://wordpress.org/extend/plugins/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](http://wordpress.org/extend/plugins/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.
 *  [Palpatine1976](https://wordpress.org/support/users/palpatine1976/)
 * (@palpatine1976)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-widget-classes-fatal-error/#post-1772200)
 * [@aizatto](https://wordpress.org/support/users/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!
 *  [Palpatine1976](https://wordpress.org/support/users/palpatine1976/)
 * (@palpatine1976)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-widget-classes-fatal-error/#post-1772201)
 * [@aizatto](https://wordpress.org/support/users/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 [http://wordpress.org/extend/plugins/wp-widget-cache/](http://wordpress.org/extend/plugins/wp-widget-cache/))
   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!
 *  [Palpatine1976](https://wordpress.org/support/users/palpatine1976/)
 * (@palpatine1976)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-widget-classes-fatal-error/#post-1772203)
 * 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](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: Widget Classes] Fatal Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-classes.svg)
 * [Widget Classes](https://wordpress.org/plugins/widget-classes/)
 * [Support Threads](https://wordpress.org/support/plugin/widget-classes/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-classes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-classes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-classes/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [Palpatine1976](https://wordpress.org/support/users/palpatine1976/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-widget-classes-fatal-error/#post-1772203)
 * Status: not resolved