nf_get_objects_by_type

Function that gets all objects of a given type.

Description

(array) nf_get_objects_by_type( $object_type ); 

Returns (array)

$results

Parameters (1)

0. $object_type
The object type.

Usage

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

Defined (1)

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

/deprecated/includes/functions.php  
  1. function nf_get_objects_by_type( $object_type ) { 
  2. global $wpdb; 
  3.  
  4. // Bail if we don't have an object type. 
  5. if ( $object_type == '' ) 
  6. return false; 
  7.  
  8. $results = $wpdb->get_results( $wpdb->prepare( 'SELECT id FROM ' . NF_OBJECTS_TABLE_NAME . ' WHERE type = %s', $object_type ), ARRAY_A ); 
  9.  
  10. return $results;