Automattic\WooCommerce\Internal\Utilities
WebhookUtil::get_webhook_ids_for_user
Get the ids of the webhooks assigned to a given user.
Метод класса: WebhookUtil{}
Хуков нет.
Возвращает
int[]. Array of webhook ids.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_webhook_ids_for_user( $user_id ): array;
- $user_id(int) (обязательный)
- User id.
Код WebhookUtil::get_webhook_ids_for_user() WebhookUtil::get webhook ids for user WC 10.7.0
private function get_webhook_ids_for_user( int $user_id ): array {
$data_store = \WC_Data_Store::load( 'webhook' );
return $data_store->search_webhooks(
array(
'user_id' => $user_id,
)
);
}