Warning: This function has been deprecated.

add_woocommerce_term_meta( int $term_id, string $meta_key, mixed $meta_value, bool $unique = false )

WooCommerce Term Meta API.


Description Description

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 Parameters

$term_id

(Required) Term ID.

$meta_key

(Required) Meta key.

$meta_value

(Required) Meta value.

$unique

(Optional) Make meta key unique. (default: false).

Default value: false


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/wc-deprecated-functions.php

function add_woocommerce_term_meta( $term_id, $meta_key, $meta_value, $unique = false ) {
	wc_deprecated_function( 'add_woocommerce_term_meta', '3.6', 'add_term_meta' );
	return function_exists( 'add_term_meta' ) ? add_term_meta( $term_id, $meta_key, $meta_value, $unique ) : add_metadata( 'woocommerce_term', $term_id, $meta_key, $meta_value, $unique );
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.6.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.