_cleanup_image_add_caption

The timeline below displays how wordpress function _cleanup_image_add_caption has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

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]);
}

WordPress Version: 5.5

/**
 * Private preg_replace callback used in image_add_caption().
 *
 * @access private
 * @since 3.4.0
 */
function _cleanup_image_add_caption($matches)
{
    // Remove any line breaks from inside the tags.
    return preg_replace('/[\r\n\t]+/', ' ', $matches[0]);
}

WordPress Version: 4.0

/**
 * Private preg_replace callback used in image_add_caption()
 *
 * @access private
 * @since 3.4.0
 */
function _cleanup_image_add_caption($matches)
{
    // Remove any line breaks from inside the tags.
    return preg_replace('/[\r\n\t]+/', ' ', $matches[0]);
}

WordPress Version: 3.7

/**
 * Private preg_replace callback used in image_add_caption()
 *
 * @access private
 * @since 3.4.0
 */
function _cleanup_image_add_caption($matches)
{
    // remove any line breaks from inside the tags
    return preg_replace('/[\r\n\t]+/', ' ', $matches[0]);
}