wxr_cdata

Wrap given string in XML CDATA tag.

Description

wxr_cdata( (string) $str ); 

Parameters (1)

0. $str (string)
String to wrap in XML CDATA tag.

Usage

  1. if ( !function_exists( 'wxr_cdata' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'advanced-custom-fields/core/actions/export.php'; 
  3.  
  4. // String to wrap in XML CDATA tag. 
  5. $str = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wxr_cdata($str); 
  9.  

Defined (1)

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

/core/actions/export.php  
  1. function wxr_cdata( $str ) { 
  2. if ( seems_utf8( $str ) == false ) 
  3. $str = utf8_encode( $str ); 
  4.  
  5. // $str = ent2ncr(esc_html($str)); 
  6. $str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '' ) . ']]>'; 
  7.  
  8. return $str;