Changeset 36101 for branches/4.4/src/wp-includes/formatting.php
- Timestamp:
- 12/26/2015 05:23:43 AM (8 years ago)
- Location:
- branches/4.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
- Property svn:mergeinfo changed
/trunk merged: 36097,36100
- Property svn:mergeinfo changed
-
branches/4.4/src/wp-includes/formatting.php
r36098 r36101 3897 3897 */ 3898 3898 function map_deep( $value, $callback ) { 3899 if ( is_array( $value ) || is_object( $value ) ) { 3900 foreach ( $value as &$item ) { 3901 $item = map_deep( $item, $callback ); 3902 } 3903 return $value; 3899 if ( is_array( $value ) ) { 3900 foreach ( $value as $index => $item ) { 3901 $value[ $index ] = map_deep( $item, $callback ); 3902 } 3903 } elseif ( is_object( $value ) ) { 3904 $object_vars = get_object_vars( $value ); 3905 foreach ( $object_vars as $property_name => $property_value ) { 3906 $value->$property_name = map_deep( $property_value, $callback ); 3907 } 3904 3908 } else { 3905 return call_user_func( $callback, $value ); 3906 } 3909 $value = call_user_func( $callback, $value ); 3910 } 3911 3912 return $value; 3907 3913 } 3908 3914
Note: See TracChangeset
for help on using the changeset viewer.