WordPress at a glance
function is not described

_cleanup_image_add_caption() WP 3.4.0

Private preg_replace callback used in image_add_caption()

No Hooks.

Return

Nothing (null).

Usage

_cleanup_image_add_caption( $matches );

Code of cleanup image add caption: wp-admin/includes/media.php VER 5.0.3

<?php
function _cleanup_image_add_caption( $matches ) {
	// Remove any line breaks from inside the tags.
	return preg_replace( '/[\r\n\t]+/', ' ', $matches[0] );
}