WordPress Version: 6.3
/**
* Private preg_replace callback used in image_add_caption().
*
* @access private
* @since 3.4.0
*
* @param array $matches Single regex match.
* @return string Cleaned up HTML for caption.
*/
function _cleanup_image_add_caption($matches)
{
// Remove any line breaks from inside the tags.
return preg_replace('/[\r\n\t]+/', ' ', $matches[0]);
}