ninja_forms_update_sub
Ninja_forms_update_sub() has been deprecated in favour of Ninja_Forms()->sub( 23 )->update_field( id, value ); Because submissions are now a CPT, this function will only return false.
Description
ninja_forms_update_sub( $args );
Please replace any instances of this function with the replacement.
Parameters (1)
- 0. $args
- The args.
Usage
if ( !function_exists( 'ninja_forms_update_sub' ) ) { require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/deprecated.php'; } // The args. $args = null; // NOTICE! Understand what this does before running. $result = ninja_forms_update_sub($args);
Defined (1)
The function is defined in the following location(s).
- /deprecated/includes/deprecated.php
- function ninja_forms_update_sub( $args ) {
- if ( ! isset ( $args['sub_id'] ) )
- return false;
- $sub_id = $args['sub_id'];
- $sub = Ninja_Forms()->sub( $sub_id );
- if ( isset ( $args['data'] ) ) {
- $data = $args['data'];
- unset ( $args['data'] );
- if ( is_serialized( $data ) ) {
- $data = unserialize( $data );
- foreach ( $data as $d ) {
- $field_id = $d['field_id'];
- $user_value = $d['user_value'];
- $sub->add_field( $field_id, $user_value );
- }
- }
- }
- foreach ( $args as $key => $value ) {
- $sub->update_meta( '_' . $key, $value );
- }
- }