WordPress at Your Fingertips
function is not described

WC_Legacy_API::add_endpoint() public WC 2.0

Add new endpoints.

{} It's a method of the class: WC_Legacy_API{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Legacy_API::add_endpoint();

Changelog

Since 2.0 Introduced.

Code of WC_Legacy_API::add_endpoint() WC 5.6.0

public static function add_endpoint() {
	// REST API, deprecated since 2.6.0.
	add_rewrite_rule( '^wc-api/v([1-3]{1})/?$', 'index.php?wc-api-version=$matches[1]&wc-api-route=/', 'top' );
	add_rewrite_rule( '^wc-api/v([1-3]{1})(.*)?', 'index.php?wc-api-version=$matches[1]&wc-api-route=$matches[2]', 'top' );
}