diff --git a/wp-content/themes/twentyfourteen/inc/widgets.php b/wp-content/themes/twentyfourteen/inc/widgets.php index d8d15c2ba4..397b2fc0d8 100644 --- a/wp-content/themes/twentyfourteen/inc/widgets.php +++ b/wp-content/themes/twentyfourteen/inc/widgets.php @@ -262,20 +262,22 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { * Here is where any validation should happen. * * @since Twenty Fourteen 1.0 + * @since Twenty Fourteen 3.3 Renamed `$instance` to `$old_instance` to match + * parent class for PHP 8 named parameter support. * * @param array $new_instance New widget instance. - * @param array $instance Original widget instance. + * @param array $old_instance Original widget instance. * @return array Updated widget instance. */ - function update( $new_instance, $instance ) { - $instance['title'] = strip_tags( $new_instance['title'] ); - $instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] ); + function update( $new_instance, $old_instance ) { + $old_instance['title'] = strip_tags( $new_instance['title'] ); + $old_instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] ); if ( in_array( $new_instance['format'], $this->formats, true ) ) { - $instance['format'] = $new_instance['format']; + $old_instance['format'] = $new_instance['format']; } - return $instance; + return $old_instance; } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 89812b9a99..620192d557 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51788'; +$wp_version = '5.9-alpha-51789'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets/class-wp-widget-media.php b/wp-includes/widgets/class-wp-widget-media.php index 25016fd268..b6eaff793e 100644 --- a/wp-includes/widgets/class-wp-widget-media.php +++ b/wp-includes/widgets/class-wp-widget-media.php @@ -259,16 +259,18 @@ abstract class WP_Widget_Media extends WP_Widget { * Sanitizes the widget form values as they are saved. * * @since 4.8.0 + * @since 5.9.0 Renamed `$instance` to `$old_instance` to match parent class + * for PHP 8 named parameter support. * * @see WP_Widget::update() * @see WP_REST_Request::has_valid_params() * @see WP_REST_Request::sanitize_params() * * @param array $new_instance Values just sent to be saved. - * @param array $instance Previously saved values from database. + * @param array $old_instance Previously saved values from database. * @return array Updated safe values to be saved. */ - public function update( $new_instance, $instance ) { + public function update( $new_instance, $old_instance ) { $schema = $this->get_instance_schema(); foreach ( $schema as $field => $field_schema ) { @@ -303,10 +305,10 @@ abstract class WP_Widget_Media extends WP_Widget { if ( is_wp_error( $value ) ) { continue; } - $instance[ $field ] = $value; + $old_instance[ $field ] = $value; } - return $instance; + return $old_instance; } /**