Changeset 51789
- Timestamp:
- 09/09/2021 08:12:58 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 2 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 -
trunk/src/wp-includes/widgets/class-wp-widget-media.php
r50995 r51789 260 260 * 261 261 * @since 4.8.0 262 * @since 5.9.0 Renamed `$instance` to `$old_instance` to match parent class 263 * for PHP 8 named parameter support. 262 264 * 263 265 * @see WP_Widget::update() … … 266 268 * 267 269 * @param array $new_instance Values just sent to be saved. 268 * @param array $ instancePreviously saved values from database.270 * @param array $old_instance Previously saved values from database. 269 271 * @return array Updated safe values to be saved. 270 272 */ 271 public function update( $new_instance, $ instance ) {273 public function update( $new_instance, $old_instance ) { 272 274 273 275 $schema = $this->get_instance_schema(); … … 304 306 continue; 305 307 } 306 $ instance[ $field ] = $value;307 } 308 309 return $ instance;308 $old_instance[ $field ] = $value; 309 } 310 311 return $old_instance; 310 312 } 311 313
Note: See TracChangeset
for help on using the changeset viewer.