A WordPress-centric search engine for devs and theme authors



delete_term_meta ›

Since4.4.0
Deprecatedn/a
delete_term_meta ( $term_id, $meta_key, $meta_value = '' )
Parameters: (3)
  • (int) $term_id Term ID.
    Required: Yes
  • (string) $meta_key Metadata name.
    Required: Yes
  • (mixed) $meta_value Optional. Metadata value. If provided, rows will only be removed that match the value.
    Required: No
    Default: (empty)
Returns:
  • (bool) True on success, false on failure.
Defined at:
Codex:

Removes metadata matching criteria from a term.



Source

function delete_term_meta( $term_id, $meta_key, $meta_value = '' ) {
	// Bail if term meta table is not installed.
	if ( get_option( 'db_version' ) < 34370 ) {
		return false;
	}

	$deleted = delete_metadata( 'term', $term_id, $meta_key, $meta_value );

	// Bust term query cache.
	if ( $deleted ) {
		wp_cache_set( 'last_changed', microtime(), 'terms' );
	}

	return $deleted;
}