at path:
ROOT
/
wp-content
/
plugins
/
woocommerce
/
src
/
StoreApi
/
functions.php
run:
R
W
Run
Exceptions
DIR
2026-04-15 05:42:47
R
W
Run
Formatters
DIR
2026-04-15 05:42:47
R
W
Run
Payments
DIR
2026-04-15 05:42:47
R
W
Run
Routes
DIR
2026-04-15 05:42:47
R
W
Run
Schemas
DIR
2026-04-15 05:42:47
R
W
Run
Utilities
DIR
2026-04-15 05:42:47
R
W
Run
Authentication.php
13.86 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
Formatters.php
1.21 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
Legacy.php
3.09 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
RoutesController.php
6.77 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
SchemaController.php
3.34 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
SessionHandler.php
4.81 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
StoreApi.php
3.52 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
deprecated.php
7.97 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
functions.php
2.7 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
error_log
up
📄
functions.php
Save
<?php /** * Helper functions for interacting with the Store API. * * This file is autoloaded via composer.json. */ use Automattic\WooCommerce\StoreApi\StoreApi; use Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema; if ( ! function_exists( 'woocommerce_store_api_register_endpoint_data' ) ) { /** * Register endpoint data under a specified namespace. * * @see Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema::register_endpoint_data() * * @param array $args Args to pass to register_endpoint_data. * @returns boolean|\WP_Error True on success, WP_Error on fail. */ function woocommerce_store_api_register_endpoint_data( $args ) { try { $extend = StoreApi::container()->get( ExtendSchema::class ); $extend->register_endpoint_data( $args ); } catch ( \Exception $error ) { return new \WP_Error( 'error', $error->getMessage() ); } return true; } } if ( ! function_exists( 'woocommerce_store_api_register_update_callback' ) ) { /** * Add callback functions that can be executed by the cart/extensions endpoint. * * @see Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema::register_update_callback() * * @param array $args Args to pass to register_update_callback. * @returns boolean|\WP_Error True on success, WP_Error on fail. */ function woocommerce_store_api_register_update_callback( $args ) { try { $extend = StoreApi::container()->get( ExtendSchema::class ); $extend->register_update_callback( $args ); } catch ( \Exception $error ) { return new \WP_Error( 'error', $error->getMessage() ); } return true; } } if ( ! function_exists( 'woocommerce_store_api_register_payment_requirements' ) ) { /** * Registers and validates payment requirements callbacks. * * @see Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema::register_payment_requirements() * * @param array $args Args to pass to register_payment_requirements. * @returns boolean|\WP_Error True on success, WP_Error on fail. */ function woocommerce_store_api_register_payment_requirements( $args ) { try { $extend = StoreApi::container()->get( ExtendSchema::class ); $extend->register_payment_requirements( $args ); } catch ( \Exception $error ) { return new \WP_Error( 'error', $error->getMessage() ); } return true; } } if ( ! function_exists( 'woocommerce_store_api_get_formatter' ) ) { /** * Returns a formatter instance. * * @see Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema::get_formatter() * * @param string $name Formatter name. * @return Automattic\WooCommerce\StoreApi\Formatters\FormatterInterface */ function woocommerce_store_api_get_formatter( $name ) { return StoreApi::container()->get( ExtendSchema::class )->get_formatter( $name ); } }