wc_gzd_unset_crud_term_data

The WooCommerce Germanized wc gzd unset crud term data function.

Description

wc_gzd_unset_crud_term_data( $object, $taxonomy ); 

Parameters (2)

0. $object
The object.
1. $taxonomy
The taxonomy.

Usage

  1. if ( !function_exists( 'wc_gzd_unset_crud_term_data' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-germanized/includes/wc-gzd-legacy-functions.php'; 
  3.  
  4. // The object. 
  5. $object = null; 
  6.  
  7. // The taxonomy. 
  8. $taxonomy = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_gzd_unset_crud_term_data($object, $taxonomy); 
  12.  

Defined (1)

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

/includes/wc-gzd-legacy-functions.php  
  1. function wc_gzd_unset_crud_term_data( $object, $taxonomy ) { 
  2. if ( wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) { 
  3. $object->update_meta_data( '_delete_' . $taxonomy, true ); 
  4. } else { 
  5. wp_delete_object_term_relationships( wc_gzd_get_crud_data( $object, 'id' ), $taxonomy ); 
  6.  
  7. return $object;