diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 8de0a1d4f2..bc17553c01 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3896,14 +3896,20 @@ function sanitize_option( $option, $value ) { * @return The value with the callback applied to all non-arrays and non-objects inside it. */ function map_deep( $value, $callback ) { - if ( is_array( $value ) || is_object( $value ) ) { - foreach ( $value as &$item ) { - $item = map_deep( $item, $callback ); + if ( is_array( $value ) ) { + foreach ( $value as $index => $item ) { + $value[ $index ] = map_deep( $item, $callback ); + } + } elseif ( is_object( $value ) ) { + $object_vars = get_object_vars( $value ); + foreach ( $object_vars as $property_name => $property_value ) { + $value->$property_name = map_deep( $property_value, $callback ); } - return $value; } else { - return call_user_func( $callback, $value ); + $value = call_user_func( $callback, $value ); } + + return $value; } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 69d5e7f91d..3acc6bd388 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4.1-alpha-36098'; +$wp_version = '4.4.1-alpha-36101'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.