WC_Webhook_Data_Store::get_webhooks_ids()
Get webhooks IDs from the database.
Метод класса: WC_Webhook_Data_Store{}
Хуков нет.
Возвращает
int[]
.
Использование
$WC_Webhook_Data_Store = new WC_Webhook_Data_Store(); $WC_Webhook_Data_Store->get_webhooks_ids( $status );
- $status(строка)
- Optional - status to filter results by. Must be a key in return value of @see wc_get_webhook_statuses(). @since 3.6.0.
По умолчанию: ''
Список изменений
С версии 3.3.0 | Введена. |
Код WC_Webhook_Data_Store::get_webhooks_ids() WC Webhook Data Store::get webhooks ids WC 8.7.0
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; }