nf_insert_object

Insert an object.

Description

(int) nf_insert_object( (string) $type, (null) $id = null ); 

Returns (int)

$object_id

Parameters (2)

0. $type (string)
The type.
1. $id — Optional. (null) => null
The id.

Usage

  1. if ( !function_exists( 'nf_insert_object' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/functions.php'; 
  3.  
  4. // The type. 
  5. $type = ''; 
  6.  
  7. // The id. 
  8. $id = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = nf_insert_object($type, $id); 
  12.  

Defined (1)

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

/deprecated/includes/functions.php  
  1. function nf_insert_object( $type, $id = NULL ) { 
  2. global $wpdb; 
  3. $wpdb->insert( NF_OBJECTS_TABLE_NAME, array( 'id' => $id, 'type' => $type ) ); 
  4. return $wpdb->insert_id;