Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_cleanup_image_add_caption() WordPress Function

The _cleanup_image_add_caption() function is a utility function that is used to add a caption to an image. This function is used by the WordPress media library when adding a caption to an image.

_cleanup_image_add_caption( $matches ) #

Private preg_replace callback used in image_add_caption().


Source

File: wp-admin/includes/media.php

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

Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More