Tribe__Process__Queue::update( string $key, array $data )

Upates the queue and meta data for the process.


Parameters

$key

(string) (Required) The key of the data to save.

$data

(array) (Required) The data to save.


Top ↑

Return

($this) This process instance.


Top ↑

Source

File: src/Tribe/Process/Queue.php

	public function update( $key, $data ) {
		$meta_key = $this->get_meta_key( $key );
		$meta     = (array) get_transient( $meta_key );
		$done     = $this->original_batch_count - count( $data );

		$update_data = array_merge( $meta, array(
			'done'        => $meta['done'] + $done,
			'last_update' => time(),
		) );

		/**
		 * Filters the information that will be updated in the database for this queue type.
		 *
		 * @since 4.7.12
		 *
		 * @param array $update_data
		 * @param self $this
		 */
		$update_data = apply_filters( "tribe_process_queue_{$this->identifier}_update_data", $update_data, $this );

		set_transient( $meta_key, $update_data, DAY_IN_SECONDS );

		return parent::update( $key, $data );
	}

Top ↑

Changelog

Changelog
Version Description
4.9.5 Pulled method from the WP_Background_Process class.
4.7.12 Introduced.