- Timestamp:
- 09/09/2021 08:12:58 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php
r47550 r51789 263 263 * 264 264 * @since Twenty Fourteen 1.0 265 * @since Twenty Fourteen 3.3 Renamed `$instance` to `$old_instance` to match 266 * parent class for PHP 8 named parameter support. 265 267 * 266 268 * @param array $new_instance New widget instance. 267 * @param array $ instanceOriginal widget instance.269 * @param array $old_instance Original widget instance. 268 270 * @return array Updated widget instance. 269 271 */ 270 function update( $new_instance, $ instance ) {271 $ instance['title'] = strip_tags( $new_instance['title'] );272 $ instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] );272 function update( $new_instance, $old_instance ) { 273 $old_instance['title'] = strip_tags( $new_instance['title'] ); 274 $old_instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] ); 273 275 274 276 if ( in_array( $new_instance['format'], $this->formats, true ) ) { 275 $ instance['format'] = $new_instance['format'];276 } 277 278 return $ instance;277 $old_instance['format'] = $new_instance['format']; 278 } 279 280 return $old_instance; 279 281 } 280 282
Note: See TracChangeset
for help on using the changeset viewer.