filter_ptags_on_images

Filter p tags.

Description

filter_ptags_on_images( $content ); 

Parameters (1)

0. $content
The content.

Usage

  1. if ( !function_exists( 'filter_ptags_on_images' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The content. 
  5. $content = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = filter_ptags_on_images($content); 
  9.  

Defined (1)

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

/functions.php  
  1. function filter_ptags_on_images($content) { 
  2. return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);