mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
Always register all widgets, props hakre, fixes #10954
git-svn-id: http://svn.automattic.com/wordpress/trunk@12249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4cb414fc17
commit
fce64c00bc
@ -126,20 +126,24 @@ class WP_Widget {
|
|||||||
|
|
||||||
function _register() {
|
function _register() {
|
||||||
$settings = $this->get_settings();
|
$settings = $this->get_settings();
|
||||||
|
$empty = true;
|
||||||
|
|
||||||
if ( empty($settings) ) {
|
if ( is_array($settings) ) {
|
||||||
// If there are none, we register the widget's existance with a
|
|
||||||
// generic template
|
|
||||||
$this->_set(1);
|
|
||||||
$this->_register_one();
|
|
||||||
} elseif ( is_array($settings) ) {
|
|
||||||
foreach ( array_keys($settings) as $number ) {
|
foreach ( array_keys($settings) as $number ) {
|
||||||
if ( is_numeric($number) ) {
|
if ( is_numeric($number) ) {
|
||||||
$this->_set($number);
|
$this->_set($number);
|
||||||
$this->_register_one($number);
|
$this->_register_one($number);
|
||||||
|
$empty = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $empty ) {
|
||||||
|
// If there are none, we register the widget's existance with a
|
||||||
|
// generic template
|
||||||
|
$this->_set(1);
|
||||||
|
$this->_register_one();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _set($number) {
|
function _set($number) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user