bp_email_plaintext_entity_decode

Decode HTML entities for plain-text emails.

Description

(string) bp_email_plaintext_entity_decode( (string) $retval, (string) $prop, (string) $transform ); 

Returns (string)

$retval Modified email content.

Parameters (3)

0. $retval (string)
Current email content.
1. $prop (string)
Email property to check against.
2. $transform (string)
Either raw or replace-tokens..

Usage

  1. if ( !function_exists( 'bp_email_plaintext_entity_decode' ) ) { 
  2. require_once '/bp-core/bp-core-filters.php'; 
  3.  
  4. // Current email content. 
  5. $retval = ''; 
  6.  
  7. // Email property to check against. 
  8. $prop = ''; 
  9.  
  10. // Either 'raw' or 'replace-tokens'. 
  11. $transform = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bp_email_plaintext_entity_decode($retval, $prop, $transform); 
  15.  

Defined (1)

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

/bp-core/bp-core-filters.php  
  1. function bp_email_plaintext_entity_decode( $retval, $prop, $transform ) { 
  2. switch ( $prop ) { 
  3. case 'content_plaintext' : 
  4. case 'subject' : 
  5. // Only decode if 'replace-tokens' is the current type. 
  6. if ( 'replace-tokens' === $transform ) { 
  7. return html_entity_decode( $retval, ENT_QUOTES ); 
  8. } else { 
  9. return $retval; 
  10. break; 
  11.  
  12. default : 
  13. return $retval; 
  14. break;