Skip to content

Commit dac203c

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 160e1fe + 64d4a6d commit dac203c

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/wp-includes/class-wp-walker.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ public function walk( $elements, $max_depth, ...$args ) {
234234
*/
235235
if ( empty( $top_level_elements ) ) {
236236

237-
$first = array_slice( $elements, 0, 1 );
238-
$root = $first[0];
237+
$root = array_first( $elements );
239238

240239
$top_level_elements = array();
241240
$children_elements = array();

src/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public function encode_form_data( $request ) {
504504
isset( $request['form_data'][ "widget-$id" ] ) &&
505505
is_array( $request['form_data'][ "widget-$id" ] )
506506
) {
507-
$new_instance = array_values( $request['form_data'][ "widget-$id" ] )[0];
507+
$new_instance = array_first( $request['form_data'][ "widget-$id" ] );
508508
$old_instance = $instance;
509509

510510
$instance = $widget_object->update( $new_instance, $old_instance );

0 commit comments

Comments
 (0)