### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
|
| 133 | 133 | $this->_set(1); |
| 134 | 134 | $this->_register_one(); |
| 135 | 135 | } elseif ( is_array($settings) ) { |
| | 136 | // If there is an array, first assume it contains a numerically |
| | 137 | // indexed set of options but that's just an assumption |
| | 138 | $count = 0; |
| 136 | 139 | foreach ( array_keys($settings) as $number ) { |
| 137 | 140 | if ( is_numeric($number) ) { |
| | 141 | $count++; |
| 138 | 142 | $this->_set($number); |
| 139 | 143 | $this->_register_one($number); |
| 140 | 144 | } |
| | 145 | } |
| | 146 | // fallback in case the assumption what the array was for |
| | 147 | // was wrong |
| | 148 | if ($count == 0) { |
| | 149 | // If there are none, we register the widget's existance with a |
| | 150 | // generic template (see if ( empty($settings) ) ) |
| | 151 | $this->_set(1); |
| | 152 | $this->_register_one(); |
| 141 | 153 | } |
| 142 | 154 | } |
| 143 | 155 | } |