ninja_forms_import_list_options
The Ninja Forms ninja forms import list options function.
Description
ninja_forms_import_list_options();
Usage
if ( !function_exists( 'ninja_forms_import_list_options' ) ) { require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/ajax.php'; } // NOTICE! Understand what this does before running. $result = ninja_forms_import_list_options();
Defined (1)
The function is defined in the following location(s).
- /deprecated/includes/admin/ajax.php
- function ninja_forms_import_list_options() {
- // Bail if we aren't in the admin
- if ( ! is_admin() )
- return false;
- check_ajax_referer( 'nf_ajax', 'nf_ajax_nonce' );
- $options = $_REQUEST['options'];
- $field_id = absint( $_REQUEST['field_id'] );
- $options = str_replace('\, ', '-comma-replace-placeholder-', $options );
- $options = ninja_forms_csv_explode( $options );
- if( is_array( $options ) ) {
- $tmp_array = array();
- $x = 0;
- foreach( $options as $option ) {
- $label = stripslashes( $option[0] );
- $value = stripslashes( $option[1] );
- $calc = stripslashes( $option[2] );
- $label = str_replace( "''", "", $label );
- $label = str_replace( "-comma-replace-placeholder-", ", ", $label );
- $value = str_replace( "''", "", $value );
- $value = str_replace( "-comma-replace-placeholder-", ", ", $value );
- $calc = str_replace( "''", "", $calc );
- $calc = str_replace( "-comma-replace-placeholder-", ", ", $calc );
- $tmp_array[$x]['label'] = $label;
- $tmp_array[$x]['value'] = $value;
- $tmp_array[$x]['calc'] = $calc;
- $x++;
- }
- $x = 0;
- foreach( $tmp_array as $option ) {
- $hidden = 0;
- ninja_forms_field_list_option_output($field_id, $x, $option, $hidden);
- $x++;
- }
- }
- die();
- }