Fix unregister_widget(). see #8441

git-svn-id: https://develop.svn.wordpress.org/trunk@10991 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-04-17 20:45:33 +00:00
parent aacf7f3f4d
commit 4fbd3a712a
1 changed files with 3 additions and 6 deletions

View File

@ -290,15 +290,12 @@ class WP_Widget_Factory {
}
function register($widget_class) {
$this->widgets[] = new $widget_class();
$this->widgets[$widget_class] = new $widget_class();
}
function unregister($widget_class) {
$offset = array_search($widget_class, $this->widgets);
if ( false === $offset )
return;
array_splice($this->widgets, $offset, 1);
if ( isset($this->widgets[$widget_class]) )
unset($this->widgets[$widget_class]);
}
function _register_widgets() {