yit_store_changes

The YITH WooCommerce Wishlist yit store changes function.

Description

yit_store_changes( $object, $key, (bool) $value = false ); 

Parameters (3)

0. $object
The object.
1. $key
The key.
2. $value — Optional. (bool) => false
The value.

Usage

  1. if ( !function_exists( 'yit_store_changes' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-wishlist/plugin-fw/yit-woocommerce-compatibility.php'; 
  3.  
  4. // The object. 
  5. $object = null; 
  6.  
  7. // The key. 
  8. $key = null; 
  9.  
  10. // The value. 
  11. $value = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = yit_store_changes($object, $key, $value); 
  15.  

Defined (1)

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

/plugin-fw/yit-woocommerce-compatibility.php  
  1. function yit_store_changes( $object, $key, $value = false ) { 
  2. global $changed_objects; 
  3.  
  4. $is_wc_data = $object instanceof WC_Data; 
  5.  
  6. if ( $is_wc_data ) { 
  7. /** 
  8. * @var $object \WC_Data 
  9. */ 
  10. $object_reference = $object->get_id(); 
  11.  
  12. $changed_objects[ $object_reference ][ 'object' ] = $object; 
  13. $changed_objects[ $object_reference ][ 'changes' ][ $key ] = $value; 
  14.  
  15.  
  16.  
  17. } else { 
  18. $changed_objects[ $object->ID ][ $key ] = $value;