nf_get_object_meta

Function that gets all the meta values attached to a given object.

Description

(array) nf_get_object_meta( (string) $object_id ); 

Returns (array)

$settings

Parameters (1)

0. $object_id (string)
The object id.

Usage

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

Defined (1)

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

/deprecated/includes/functions.php  
  1. function nf_get_object_meta( $object_id ) { 
  2. global $wpdb; 
  3.  
  4. $tmp_array = array(); 
  5. $settings = $wpdb->get_results( $wpdb->prepare( 'SELECT meta_key, meta_value FROM ' . NF_OBJECT_META_TABLE_NAME . ' WHERE object_id = %d', $object_id ), ARRAY_A); 
  6.  
  7. if ( is_array( $settings ) ) { 
  8. foreach( $settings as $setting ) { 
  9. $tmp_array[ $setting['meta_key'] ] = $setting['meta_value'] = maybe_unserialize( $setting['meta_value'] ); 
  10.  
  11. return $tmp_array;