WC_Legacy_API::add_endpoint()

Add new endpoints.


Description Description


Source Source

File: includes/legacy/class-wc-legacy-api.php

70
71
72
73
74
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' );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.