wpsc_add_visitor_meta

Add meta data field to a visitor.

Description

wpsc_add_visitor_meta( (int) $visitor_id, (string) $meta_key, (mixed) $meta_value, (bool) $unique = false ); 

This meta data function mirrors a corresponding wordpress post meta function.

Parameters (4)

0. $visitor_id (int)
The visitor id.
1. $meta_key (string)
Metadata name.
2. $meta_value (mixed)
The meta value.
3. $unique — Optional. (bool) => false
Optional, default is false. Whether the same key should not be added.

Usage

  1. if ( !function_exists( 'wpsc_add_visitor_meta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'wp-ecommerce/wpsc-includes/wpsc-meta-visitor.php'; 
  3.  
  4. // The visitor id. 
  5. $visitor_id = -1; 
  6.  
  7. // Metadata name. 
  8. $meta_key = ''; 
  9.  
  10. // The meta value. 
  11. $meta_value = null; 
  12.  
  13. // Optional, default is false. Whether the same key should not be added. 
  14. $unique = false; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = wpsc_add_visitor_meta($visitor_id, $meta_key, $meta_value, $unique); 
  18.  

Defined (1)

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

/wpsc-includes/wpsc-meta-visitor.php