frontier_template_blocks

Processes before and after template blocks.

Description

(null) frontier_template_blocks( (array) $atts, (string) $code, (string) $slug ); 

Returns (null)

Parameters (3)

0. $atts (array)
Attributes from template
1. $code (string)
Encoded template to be decoded
2. $slug (string)
Shortcode slug used to process

Usage

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

Defined (1)

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

/components/Templates/includes/functions-view_template.php  
  1. function frontier_template_blocks( $atts, $code, $slug ) { 
  2.  
  3. global $template_post_blocks; 
  4. if ( !isset( $template_post_blocks ) ) { 
  5. $template_post_blocks = array( 
  6. 'before' => null,  
  7. 'after' => null,  
  8. ); 
  9. if ( $slug === 'pod_before_template' ) { 
  10. if ( !isset( $template_post_blocks[ 'before' ][ $atts[ pod ] ] ) ) { 
  11. $template_post_blocks[ 'before' ][ $atts[ pod ] ] = pods_do_shortcode( frontier_decode_template( $code, $atts ), array( 
  12. 'if',  
  13. 'else' 
  14. ) ); 
  15.  
  16. elseif ( $slug === 'pod_after_template' ) { 
  17. if ( !isset( $template_post_blocks[ 'after' ][ $atts[ pod ] ] ) ) { 
  18. $template_post_blocks[ 'after' ][ $atts[ pod ] ] = pods_do_shortcode( frontier_decode_template( $code, $atts ), array( 
  19. 'if',  
  20. 'else' 
  21. ) ); 
  22.  
  23. return null;