WC_Legacy_API::register_resources()
Deprecated from version 2.6.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.
Register available API resources.
Method of the class: WC_Legacy_API{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$WC_Legacy_API = new WC_Legacy_API(); $WC_Legacy_API->register_resources( $server );
- $server(WC_API_Server) (required)
- the REST server.
Changelog
Since 2.1 | Introduced. |
Deprecated since | 2.6.0 |
WC_Legacy_API::register_resources() WC Legacy API::register resources code WC 8.7.0
public function register_resources( $server ) { $api_classes = apply_filters( 'woocommerce_api_classes', array( 'WC_API_Coupons', 'WC_API_Customers', 'WC_API_Orders', 'WC_API_Products', 'WC_API_Reports', 'WC_API_Taxes', 'WC_API_Webhooks', ) ); foreach ( $api_classes as $api_class ) { $this->$api_class = new $api_class( $server ); } }