frontier_decode_template

Decodes a like nested shortcode based template.

Description

(string) frontier_decode_template( (string) $code, (array) $atts ); 

Returns (string)

Parameters (2)

0. $code (string)
Encoded template to be decoded
1. $atts (array)
Attributed provided from parent

Usage

  1. if ( !function_exists( 'frontier_decode_template' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'pods-custom-content-types-and-fields/components/Templates/includes/functions-view_template.php'; 
  3.  
  4. // encoded template to be decoded 
  5. $code = ''; 
  6.  
  7. // attributed provided from parent 
  8. $atts = array(); 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = frontier_decode_template($code, $atts); 
  12.  

Defined (1)

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

/components/Templates/includes/functions-view_template.php  
  1. function frontier_decode_template( $code, $atts ) { 
  2.  
  3. $code = base64_decode( $code ); 
  4. $pod =pods $atts[ pod ] ); 
  5.  
  6. if ( isset( $atts[ pod ] ) ) { 
  7. $code = str_replace( '@pod', $atts[ pod ], $code ); 
  8. if ( isset( $atts[ 'id' ] ) ) { 
  9. $code = str_replace( '{@EntryID}', $atts[ 'id' ], $code ); 
  10. if ( isset( $atts[ 'index' ] ) ) { 
  11. $code = str_replace( '{_index}', $atts[ 'index' ], $code ); 
  12.  
  13. return $code;