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:
parent
aacf7f3f4d
commit
4fbd3a712a
@ -290,15 +290,12 @@ class WP_Widget_Factory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function register($widget_class) {
|
function register($widget_class) {
|
||||||
$this->widgets[] = new $widget_class();
|
$this->widgets[$widget_class] = new $widget_class();
|
||||||
}
|
}
|
||||||
|
|
||||||
function unregister($widget_class) {
|
function unregister($widget_class) {
|
||||||
$offset = array_search($widget_class, $this->widgets);
|
if ( isset($this->widgets[$widget_class]) )
|
||||||
if ( false === $offset )
|
unset($this->widgets[$widget_class]);
|
||||||
return;
|
|
||||||
|
|
||||||
array_splice($this->widgets, $offset, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _register_widgets() {
|
function _register_widgets() {
|
||||||
|
Loading…
Reference in New Issue
Block a user