ninja_forms_register_field_tax

Function to register a new field for payment tax.

Description

ninja_forms_register_field_tax(); 

Usage

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

Defined (1)

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

/deprecated/includes/fields/tax.php  
  1. function ninja_forms_register_field_tax() { 
  2. $args = array( 
  3. 'name' => __( 'Tax', 'ninja-forms' ),  
  4. 'sidebar' => '',  
  5. 'display_function' => 'ninja_forms_field_tax_display',  
  6. 'group' => 'standard_fields',  
  7. 'edit_conditional' => true,  
  8. 'edit_req' => false,  
  9. 'edit_options' => array( 
  10. array( 
  11. 'type' => 'text',  
  12. 'name' => 'default_value',  
  13. 'label' => __( 'Tax Percentage', 'ninja-forms' ),  
  14. 'class' => 'widefat',  
  15. 'desc' => __( 'Should be entered as a percentage. e.g. 8.25%, 4%', 'ninja-forms' ),  
  16. ),  
  17. array( 
  18. 'type' => 'hidden',  
  19. 'name' => 'payment_field_group',  
  20. 'default' => 1,  
  21. ),  
  22. array( 
  23. 'type' => 'hidden',  
  24. 'name' => 'payment_tax',  
  25. 'default' => 1,  
  26. ),  
  27. ),  
  28. 'save_function' => 'ninja_forms_field_tax_save',  
  29. ); 
  30.  
  31. ninja_forms_register_field( '_tax', $args );