WC_Webhook_Data_Store::get_webhooks_ids( string $status = '' )

Get webhooks IDs from the database.


Description Description


Parameters Parameters

$status

(Optional) - status to filter results by. Must be a key in return value of @see wc_get_webhook_statuses(). @since 3.6.0.

Default value: ''


Top ↑

Return Return

(int[])


Top ↑

Source Source

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

	public function get_webhooks_ids( $status = '' ) {
		if ( ! empty( $status ) ) {
			$this->validate_status( $status );
		}

		$ids = get_transient( $this->get_transient_key( $status ) );

		if ( false === $ids ) {
			$ids = $this->search_webhooks(
				array(
					'limit'  => -1,
					'status' => $status,
				)
			);
			$ids = array_map( 'absint', $ids );
			set_transient( $this->get_transient_key( $status ), $ids );
		}

		return $ids;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.