delete_woocommerce_term_meta

WooCommerce Term Meta API.

Description

delete_woocommerce_term_meta( (mixed) $term_id, (string) $meta_key, (string) $meta_value = '', (bool) $deprecated = false ); 

WC tables for storing term meta are @deprecated from WordPress 4.4 since 4.4 has its own table. This function serves as a wrapper, using the new table if present, or falling back to the WC table.

Parameters (4)

0. $term_id (mixed)
The term id.
1. $meta_key (string)
The meta key.
2. $meta_value — Optional. (string) => ''
The meta value.
3. $deprecated — Optional. (bool) => false
(default: false)

Usage

  1. if ( !function_exists( 'delete_woocommerce_term_meta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-term-functions.php'; 
  3.  
  4. // The term id. 
  5. $term_id = null; 
  6.  
  7. // The meta key. 
  8. $meta_key = ''; 
  9.  
  10. // The meta value. 
  11. $meta_value = ''; 
  12.  
  13. // (default: false) 
  14. $deprecated = false; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = delete_woocommerce_term_meta($term_id, $meta_key, $meta_value, $deprecated); 
  18.  

Defined (1)

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

/includes/wc-term-functions.php  
  1. function delete_woocommerce_term_meta( $term_id, $meta_key, $meta_value = '', $deprecated = false ) { 
  2. return function_exists( 'delete_term_meta' ) ? delete_term_meta( $term_id, $meta_key, $meta_value ) : delete_metadata( 'woocommerce_term', $term_id, $meta_key, $meta_value );