WordPress at Your Fingertips
function is not described

_cleanup_image_add_caption() WP 3.4.0

Private preg_replace callback used in image_add_caption().

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

null. Nothing.

Usage

_cleanup_image_add_caption( $matches );
$matches (required)
-

Changelog

Since 3.4.0 Introduced.

Code of _cleanup_image_add_caption() WP 5.8.2

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