PHP 8.2.31
Preview: functions.php Size: 2.70 KB
//proc/self/root/home/nshryvcy/taramarriagebureau.com/wp-content/plugins/woocommerce/src/StoreApi/functions.php

<?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 );
	}
}

Directory Contents

Dirs: 6 × Files: 9

Name Size Perms Modified Actions
- drwxr-xr-x 2026-03-03 06:25:16
Edit Download
- drwxr-xr-x 2026-03-03 06:25:16
Edit Download
Payments DIR
- drwxr-xr-x 2026-03-03 06:25:16
Edit Download
Routes DIR
- drwxr-xr-x 2026-03-03 06:25:16
Edit Download
Schemas DIR
- drwxr-xr-x 2026-03-03 06:25:16
Edit Download
Utilities DIR
- drwxr-xr-x 2026-03-03 06:25:16
Edit Download
11.95 KB lrw-r--r-- 2026-03-03 06:25:16
Edit Download
7.97 KB lrw-r--r-- 2026-03-03 06:25:16
Edit Download
1.21 KB lrw-r--r-- 2026-03-03 06:25:16
Edit Download
2.70 KB lrw-r--r-- 2026-03-03 06:25:16
Edit Download
3.09 KB lrw-r--r-- 2026-03-03 06:25:16
Edit Download
6.21 KB lrw-r--r-- 2026-03-03 06:25:16
Edit Download
3.32 KB lrw-r--r-- 2026-03-03 06:25:16
Edit Download
2.66 KB lrw-r--r-- 2026-03-03 06:25:16
Edit Download
3.25 KB lrw-r--r-- 2026-03-03 06:25:16
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).