Automattic\WooCommerce\Internal\Utilities
LegacyRestApiStub::add_rewrite_rules_for_legacy_rest_api_stub()
Add the necessary rewrite rules for the Legacy REST API (either the dedicated extension if it's installed, or the stub otherwise).
Метод класса: LegacyRestApiStub{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$result = LegacyRestApiStub::add_rewrite_rules_for_legacy_rest_api_stub();
Код LegacyRestApiStub::add_rewrite_rules_for_legacy_rest_api_stub() LegacyRestApiStub::add rewrite rules for legacy rest api stub WC 9.3.3
private static function add_rewrite_rules_for_legacy_rest_api_stub() { 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' ); add_rewrite_endpoint( 'wc-api', EP_ALL ); }