nf_edit_field_sort_numeric

Function used to output the submission sorting option on the backend.

Description

nf_edit_field_sort_numeric( $field_id, $field_data ); 

Parameters (2)

0. $field_id
The field id.
1. $field_data
The field data.

Usage

  1. if ( !function_exists( 'nf_edit_field_sort_numeric' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/edit-field/sub-settings.php'; 
  3.  
  4. // The field id. 
  5. $field_id = null; 
  6.  
  7. // The field data. 
  8. $field_data = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = nf_edit_field_sort_numeric($field_id, $field_data); 
  12.  

Defined (1)

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

/deprecated/includes/admin/edit-field/sub-settings.php  
  1. function nf_edit_field_sort_numeric( $field_id, $field_data ) { 
  2. global $ninja_forms_fields; 
  3.  
  4. $field_row = ninja_forms_get_field_by_id( $field_id ); 
  5. $field_type = $field_row['type']; 
  6.  
  7. if ( $ninja_forms_fields[$field_type]['process_field'] && $field_type != '_calc' ) { 
  8. if ( isset ( $field_data['admin_label'] ) ) { 
  9. $admin_label = $field_data['admin_label']; 
  10. } else { 
  11. $admin_label = ''; 
  12. if ( isset ( $field_data['num_sort'] ) ) { 
  13. $num_sort = $field_data['num_sort']; 
  14. } else { 
  15. $num_sort = ''; 
  16. ?> 
  17. <div class="description description-wide"> 
  18. <?php 
  19. ninja_forms_edit_field_el_output( $field_id, 'checkbox', __( 'Sort as numeric', 'ninja-forms' ), 'num_sort', $num_sort, 'wide', '', '', __( 'If this box is checked, this column in the submissions table will sort by number.', 'ninja-forms' ) ); 
  20. ?> 
  21. </div> 
  22. <?php