__( 'Active', 'woocommerce' ), 'paused' => __( 'Paused', 'woocommerce' ), 'disabled' => __( 'Disabled', 'woocommerce' ), ) ); } /** * Load webhooks. * * @since 3.3.0 * @return bool */ function wc_load_webhooks() { $data_store = WC_Data_Store::load( 'webhook' ); $webhooks = $data_store->get_webhooks_ids(); $loaded = false; foreach ( $webhooks as $webhook_id ) { $webhook = new WC_Webhook( $webhook_id ); $webhook->enqueue(); $loaded = true; } return $loaded; } /** * Get webhook. * * @param int $id Webhook ID. * @return WC_Webhook|null */ function wc_get_webhook( $id ) { $webhook = new WC_Webhook( (int) $id ); return 0 !== $webhook->get_id() ? $webhook : null; }