_cleanup_image_add_caption()
Private preg_replace callback used in image_add_caption().
Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.
No Hooks.
Returns
String. Cleaned up HTML for caption.
Usage
_cleanup_image_add_caption( $matches );
- $matches(array) (required)
- Single regex match.
Changelog
| Since 3.4.0 | Introduced. |
_cleanup_image_add_caption() cleanup image add caption code WP 6.9.1
function _cleanup_image_add_caption( $matches ) {
// Remove any line breaks from inside the tags.
return preg_replace( '/[\r\n\t]+/', ' ', $matches[0] );
}