my_custom_field_register

The Ninja Forms my custom field register function.

Description

my_custom_field_register(); 

Usage

  1. if ( !function_exists( 'my_custom_field_register' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/field-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = my_custom_field_register(); 
  7.  

Defined (1)

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

/deprecated/includes/fields/field-template.php  
  1. function my_custom_field_register() { 
  2. $args = array( 
  3. 'name' => 'File Upload',  
  4. 'edit_options' => array( 
  5. array( 
  6. 'type' => 'text',  
  7. 'name' => 'my_text',  
  8. 'label' => 'My Text Label',  
  9. 'class' => 'widefat',  
  10. ),  
  11. array( 
  12. 'type' => 'select',  
  13. 'name' => 'my_select',  
  14. 'label' => 'My Select Label',  
  15. ),  
  16. ),  
  17. 'display_function' => 'ninja_forms_field_upload_display',  
  18. 'sub_edit_function' => 'ninja_forms_field_upload_sub_edit',  
  19. 'group' => '',  
  20. 'edit_label' => true,  
  21. 'edit_label_pos' => true,  
  22. 'edit_req' => true,  
  23. 'edit_custom_class' => true,  
  24. 'edit_help' => true,  
  25. 'edit_meta' => false,  
  26. 'sidebar' => 'template_fields',  
  27. 'edit_conditional' => true,  
  28. 'conditional' => array( 
  29. 'value' => array( 
  30. 'type' => 'text',  
  31. ),  
  32. ),  
  33. 'pre_process' => 'ninja_forms_field_upload_pre_process',  
  34. 'process' => 'ninja_forms_field_upload_process',  
  35. 'req_validation' => 'ninja_forms_field_upload_req_validation',  
  36. ); 
  37.  
  38. ninja_forms_register_field('_upload', $args);