_cleanup_image_add_caption

Private preg_replace callback used in image_add_caption().

Description

_cleanup_image_add_caption( $matches ); 

Parameters (1)

0. $matches
The matches.

Usage

  1. if ( !function_exists( '_cleanup_image_add_caption' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/media.php'; 
  3.  
  4. // The matches. 
  5. $matches = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = _cleanup_image_add_caption($matches); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/media.php  
  1. function _cleanup_image_add_caption( $matches ) { 
  2. // Remove any line breaks from inside the tags. 
  3. return preg_replace( '/[\r\n\t]+/', ' ', $matches[0] );