WC_Data_Store_WP::delete_from_lookup_table( int $id, string $table )

Delete lookup table data for an ID.


Description Description


Parameters Parameters

$id

(Required) ID of object to update.

$table

(Required) Lookup table name.


Top ↑

Source Source

File: includes/data-stores/class-wc-data-store-wp.php

	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 );
	}

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.