ninja_forms_register_field_calc
Function to register a new field for calculations.
Description
ninja_forms_register_field_calc();
Usage
if ( !function_exists( 'ninja_forms_register_field_calc' ) ) { require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/calc.php'; } // NOTICE! Understand what this does before running. $result = ninja_forms_register_field_calc();
Defined (1)
The function is defined in the following location(s).
- /deprecated/includes/fields/calc.php
- function ninja_forms_register_field_calc() {
- $args = array(
- 'name' => __( 'Calculation', 'ninja-forms' ),
- 'sidebar' => 'template_fields',
- 'edit_function' => 'ninja_forms_field_calc_edit',
- 'display_function' => 'ninja_forms_field_calc_display',
- 'group' => 'standard_fields',
- 'edit_conditional' => true,
- 'edit_req' => false,
- 'edit_label' => false,
- 'edit_label_pos' => false,
- 'edit_custom_class' => false,
- 'edit_help' => false,
- //'process_field' => false,
- //'pre_process' => 'ninja_forms_field_calc_strip_currency_symbol',
- 'edit_options' => array(
- array(
- 'type' => 'hidden',
- 'name' => 'payment_field_group',
- 'default' => 1,
- ),
- array(
- 'type' => 'hidden',
- 'name' => 'payment_total',
- //'label' => __( 'Total', 'ninja-forms' ),
- ),
- array(
- 'type' => 'hidden',
- 'name' => 'payment_sub_total',
- //'label' => __( 'Sub Total', 'ninja-forms' ),
- ),
- array(
- 'type' => 'text',
- 'name' => 'calc_places',
- 'label' => __( 'Number of decimal places.', 'ninja-forms' ),
- 'default' => 2,
- ),
- ),
- 'conditional' => array(
- 'value' => array(
- 'type' => 'text',
- ),
- ),
- );
- ninja_forms_register_field( '_calc', $args );
- }