nf_get_object_type

Get an object's type.

Description

(string) nf_get_object_type( $object_id ); 

Returns (string)

$return

Parameters (1)

0. $object_id
The object id.

Usage

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

Defined (1)

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

/deprecated/includes/functions.php  
  1. function nf_get_object_type( $object_id ) { 
  2. global $wpdb; 
  3. // Get our object type 
  4. $type = $wpdb->get_row( $wpdb->prepare( 'SELECT type FROM ' . NF_OBJECTS_TABLE_NAME . ' WHERE id = %d', $object_id ), ARRAY_A ); 
  5. $return = ( isset ( $type['type'] ) ) ? $type['type'] : false; 
  6. return $return;