@since 2.3.0 * @return array */ function wc_get_webhook_statuses() { return apply_filters( 'woocommerce_webhook_statuses', array( 'active' => __( 'Active', 'woocommerce' ), 'paused' => __( 'Paused', 'woocommerce' ), 'disabled' => __( 'Disabled', 'woocommerce' ), ) ); } /** * Load webhooks. * * @since 3.3.0 * @throws Exception If webhook cannot be read/found and $data parameter of WC_Webhook class constructor is set. * @param string $status Optional - status to filter results by. Must be a key in return value of @see wc_get_webhook_statuses(). @since 3.5.0. * @param null|int $limit Limit number of webhooks loaded. @since 3.6.0. * @return bool */ function wc_load_webhooks( $status = '', $limit = null ) { // short-circuit if webhooks should not be loaded at all. if ( ! is_null( $limit ) && $limit <= 0 ) { return false; } $data_store = WC_Data_Store::load( 'webhook' ); $webhooks = $data_store->get_webhooks_ids( $status ); $loaded = 0; foreach ( $webhooks as $webhook_id ) { if ( ! is_null( $limit ) && $loaded >= $limit ) { break; } $webhook = new WC_Webhook( $webhook_id ); $webhook->enqueue(); $loaded ++; } return 0 < $loaded; } /** * Get webhook. * * @param int|WC_Webhook $id Webhook ID or object. * @throws Exception If webhook cannot be read/found and $data parameter of WC_Webhook class constructor is set. * @return WC_Webhook|null */ function wc_get_webhook( $id ) { $webhook = new WC_Webhook( $id ); return 0 !== $webhook->get_id() ? $webhook : null; } /** * Get webhoook REST API versions. * * @since 3.5.1 * @return array */ function wc_get_webhook_rest_api_versions() { return array( 'wp_api_v1', 'wp_api_v2', 'wp_api_v3', ); }
Fatal error: Uncaught Error: Call to undefined function wc_load_webhooks() in /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php:961 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php(795): WooCommerce->load_webhooks() #1 /htdocs/wp-includes/class-wp-hook.php(324): WooCommerce->init('') #2 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /htdocs/wp-settings.php(704): do_action('init') #5 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #6 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #7 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #8 /htdocs/index.php(17): require('/htdocs/wp-blog...') #9 {main} thrown in /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php on line 961