fix_line_breaks

The Advanced Custom Fields fix line breaks function.

Description

fix_line_breaks( $v ); 

This function will loop through all array pieces and correct double line breaks from DB to XML

Parameters (1)

0. $v
The v.

Usage

  1. if ( !function_exists( 'fix_line_breaks' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'advanced-custom-fields/core/actions/export.php'; 
  3.  
  4. // The v. 
  5. $v = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = fix_line_breaks($v); 
  9.  

Defined (1)

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

/core/actions/export.php  
  1. function fix_line_breaks( $v ) 
  2. if( is_array($v) ) 
  3. foreach( array_keys($v) as $k ) 
  4. $v[ $k ] = fix_line_breaks( $v[ $k ] ); 
  5. elseif( is_string($v) ) 
  6. $v = str_replace("\r\n", "\r", $v); 
  7.  
  8. return $v;