WordPress at Your Fingertips
function is not described

WC_Data_Store_WP::delete_from_lookup_table() public WC 3.6.0

Delete lookup table data for an ID.

{} It's a method of the class: WC_Data_Store_WP{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Data_Store_WP = new WC_Data_Store_WP();
$WC_Data_Store_WP->delete_from_lookup_table( $id, $table );
$id(int) (required)
ID of object to update.
$table(string) (required)
Lookup table name.

Changelog

Since 3.6.0 Introduced.

Code of WC_Data_Store_WP::delete_from_lookup_table() WC 5.6.0

public function delete_from_lookup_table( $id, $table ) {
	global $wpdb;

	$id    = absint( $id );
	$table = sanitize_key( $table );

	if ( empty( $id ) || empty( $table ) ) {
		return false;
	}

	$pk = $this->get_primary_key_for_lookup_table( $table );

	$wpdb->delete(
		$wpdb->$table,
		array(
			$pk => $id,
		)
	);
	wp_cache_delete( 'lookup_table', 'object_' . $id );
}