WC_Legacy_API::add_endpoint()
Add new endpoints.
Метод класса: WC_Legacy_API{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$result = WC_Legacy_API::add_endpoint();
Список изменений
С версии 2.0 | Введена. |
Код WC_Legacy_API::add_endpoint() WC Legacy API::add endpoint WC 7.5.1
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' ); }