WC_API_Webhooks::get_webhooks( array $fields = null, array $filter = array(), string $status = null, int $page = 1 )
Get all webhooks
Description Description
Parameters Parameters
- $fields
-
(Optional)
Default value: null
- $filter
-
(Optional)
Default value: array()
- $status
-
(Optional)
Default value: null
- $page
-
(Optional)
Default value: 1
Return Return
(array)
Source Source
File: includes/legacy/api/v2/class-wc-api-webhooks.php
public function get_webhooks( $fields = null, $filter = array(), $status = null, $page = 1 ) {
if ( ! empty( $status ) ) {
$filter['status'] = $status;
}
$filter['page'] = $page;
$query = $this->query_webhooks( $filter );
$webhooks = array();
foreach ( $query['results'] as $webhook_id ) {
$webhooks[] = current( $this->get_webhook( $webhook_id, $fields ) );
}
$this->server->add_pagination_headers( $query['headers'] );
return array( 'webhooks' => $webhooks );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.2 | Introduced. |