map_deep( mixed $value, callable $callback ): mixed  Maps a function to all non-iterable elements of an array or an object.   Description This is similar to array_walk_recursive() but acts upon objects too.   Parameters   $value mixed Required    The array, object, or scalar.    $callback callable Required    The function to map onto $value.      Return mixed The value with the callback applied to all non-arrays and non-objects inside it.   Source  File: wp-includes/formatting.php. View all references  function map_deep( $value, $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 );
		}
	} else {
		$value = call_user_func( $callback, $value );
	}

	return $value;
}
   Related  Uses    Uses Description      map_deep() wp-includes/formatting.php   Maps a function to all non-iterable elements of an array or an object.   
   Used By    Used By Description      wp_slash_strings_only() wp-includes/deprecated.php   Adds slashes to only string values in an array of values.     wp_kses_post_deep() wp-includes/kses.php   Navigates through an array, object, or scalar, and sanitizes content for allowed HTML tags for post content.     map_deep() wp-includes/formatting.php   Maps a function to all non-iterable elements of an array or an object.     urldecode_deep() wp-includes/formatting.php   Navigates through an array, object, or scalar, and decodes URL-encoded values     stripslashes_deep() wp-includes/formatting.php   Navigates through an array, object, or scalar, and removes slashes from the values.     urlencode_deep() wp-includes/formatting.php   Navigates through an array, object, or scalar, and encodes the values to be used in a URL.     rawurlencode_deep() wp-includes/formatting.php   Navigates through an array, object, or scalar, and raw-encodes the values to be used in a URL.   
    Changelog    Version Description     4.4.0 Introduced.    

    
{'path': 'public/docs/wordpress/functions/map_deep.html', 'source': 'DevDocs.IO'}