Tribe__Tickets_Plus__Meta__Storage::delete_meta_data_for( null|int $id, null|string $hash_key = null )

Delete transient for meta.


Parameters

$id

(null|int) (Required) Post ID (or null if using current post). Note: This is only for context, it does not affect what is deleted.

$hash_key

(null|string) (Optional) The hash key.

Default value: null


Top ↑

Return

(boolean) Whether the transient was deleted.


Top ↑

Source

File: src/Tribe/Meta/Storage.php

	public function delete_meta_data_for( $id, $hash_key = null ) {
		$id = (int) $id;

		$data = $this->get_meta_data( $id, $hash_key );

		if ( empty( $data ) ) {
			return false;
		}

		if ( ! isset( $data[ $id ] ) ) {
			return false;
		}

		unset( $data[ $id ] );

		if ( isset( $this->data_cache[ $id ] ) ) {
			unset( $this->data_cache[ $id ] );
		}

		if ( empty( $data ) ) {
			$this->delete_meta_data( $id, $hash_key );
		} else {
			$this->update_meta_data( $data, $id, $hash_key );
		}

		return true;
	}

Top ↑

Changelog

Changelog
Version Description
4.11.0 Introduced.