get_woocommerce_api_url()
Устарела с версии 9.0.0 The Legacy REST API has been removed from WooCommerce core.. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.
Get the URL to the WooCommerce Legacy REST API.
Note that as of WooCommerce 9.0 the WooCommerce Legacy REST API has been moved to a dedicated extension, and the implementation of its root endpoint in WooCommerce core is now just a stub that will always return an error. See the setup_legacy_api_stub method in includes/class-woocommerce.php and: https://developer.woocommerce.com/2023/10/03/the-legacy-rest-api-will-move-to-a-dedicated-extension-in-woocommerce-9-0/
Хуков нет.
Возвращает
Строку
. the URL.
Использование
get_woocommerce_api_url( $path );
- $path(строка) (обязательный)
- an endpoint to include in the URL.
Список изменений
С версии 2.1 | Введена. |
Устарела с 9.0.0 | The Legacy REST API has been removed from WooCommerce core. |
Код get_woocommerce_api_url() get woocommerce api url WC 9.5.1
function get_woocommerce_api_url( $path ) { $url = get_home_url( null, 'wc-api/v3/', is_ssl() ? 'https' : 'http' ); if ( ! empty( $path ) && is_string( $path ) ) { $url .= ltrim( $path, '/' ); } return $url; }