diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index 05b103e6f7..6504cee240 100644
a
|
b
|
function map_deep( $value, $callback ) { |
5145 | 5145 | } elseif ( is_object( $value ) ) { |
5146 | 5146 | $object_vars = get_object_vars( $value ); |
5147 | 5147 | foreach ( $object_vars as $property_name => $property_value ) { |
5148 | | $value->$property_name = map_deep( $property_value, $callback ); |
| 5148 | $reflection_property = new ReflectionProperty( $value, $property_name ); |
| 5149 | if ( ! $reflection_property->isReadOnly() ) { |
| 5150 | $value->$property_name = map_deep( $property_value, $callback ); |
| 5151 | } |
5149 | 5152 | } |
5150 | 5153 | } else { |
5151 | 5154 | $value = call_user_func( $callback, $value ); |