nf_field_list_sub_table_value

Output our user value on the sub table.

Description

nf_field_list_sub_table_value( $field_id, $user_value ); 

Parameters (2)

0. $field_id
The field id.
1. $user_value
The user value.

Usage

  1. if ( !function_exists( 'nf_field_list_sub_table_value' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/list.php'; 
  3.  
  4. // The field id. 
  5. $field_id = null; 
  6.  
  7. // The user value. 
  8. $user_value = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = nf_field_list_sub_table_value($field_id, $user_value); 
  12.  

Defined (1)

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

/deprecated/includes/fields/list.php  
  1. function nf_field_list_sub_table_value( $field_id, $user_value ) { 
  2. if ( is_array ( $user_value ) ) { 
  3. echo '<ul>'; 
  4. $max_items = apply_filters( 'nf_sub_table_user_value_max_items', 3, $field_id ); 
  5. $x = 0; 
  6.  
  7. while ( $x < $max_items && $x <= count( $user_value ) - 1 ) { 
  8. echo '<li>' . $user_value[$x] . '</li>'; 
  9. $x++; 
  10. echo '</ul>'; 
  11. } else { 
  12. $max_len = apply_filters( 'nf_sub_table_user_value_max_len', 140, $field_id ); 
  13. if ( strlen( $user_value ) > 140 ) 
  14. $user_value = substr( $user_value, 0, 140 ); 
  15.  
  16. echo nl2br( $user_value );