Automattic\WooCommerce\Internal\Utilities
LegacyRestApiStub::get_endpoint_data
Get data from a WooCommerce API endpoint. This method used to be part of the WooCommerce Legacy REST API.
Method of the class: LegacyRestApiStub{}
No Hooks.
Returns
Array|\WP_Error.
Usage
$LegacyRestApiStub = new LegacyRestApiStub(); $LegacyRestApiStub->get_endpoint_data( $endpoint, $params );
- $endpoint(string) (required)
- Endpoint.
- $params(array)
- Params to pass with request.
Default: array()
Changelog
| Since 9.1.0 | Introduced. |
LegacyRestApiStub::get_endpoint_data() LegacyRestApiStub::get endpoint data code WC 10.3.3
public function get_endpoint_data( $endpoint, $params = array() ) {
wc_doing_it_wrong(
'get_endpoint_data',
"'WC()->api->get_endpoint_data' is deprecated, please use the following instead: wc_get_container()->get(Automattic\WooCommerce\Utilities\RestApiUtil::class)->get_endpoint_data",
'9.1.0'
);
return $this->rest_api_util->get_endpoint_data( $endpoint, $params );
}