field_line_template

The Caldera Forms field line template function.

Description

field_line_template( (string) $id = '{{id}}', (string) $label = '{{label}}', (string) $group = '{{group}}' ); 

Parameters (3)

0. $id — Optional. (string) => '{{id}}'
The id.
1. $label — Optional. (string) => '{{label}}'
The label.
2. $group — Optional. (string) => '{{group}}'
The group.

Usage

  1. if ( !function_exists( 'field_line_template' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'caldera-forms/ui/edit.php'; 
  3.  
  4. // The id. 
  5. $id = '{{id}}'; 
  6.  
  7. // The label. 
  8. $label = '{{label}}'; 
  9.  
  10. // The group. 
  11. $group = '{{group}}'; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = field_line_template($id, $label, $group); 
  15.  

Defined (1)

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

/ui/edit.php  
  1. function field_line_template($id = '{{id}}', $label = '{{label}}', $group = '{{group}}') { 
  2.  
  3. ob_start(); 
  4.  
  5. ?> 
  6. <li data-field="<?php echo $id; ?>" class="caldera-field-line"> 
  7. <a href="#<?php echo $id; ?>"> 
  8. <i class="icn-right pull-right"></i> 
  9. <i class="icn-field"></i> 
  10. <?php echo htmlentities( $label ); ?> 
  11. </a> 
  12. <input type="hidden" class="caldera-config-field-group" value="<?php echo $group; ?>" name="config[fields][<?php echo $id; ?>][group]" autocomplete="off"> 
  13. </li> 
  14. <?php 
  15.  
  16. return ob_get_clean();