Skip to content

Instantly share code, notes, and snippets.

@oterox
Last active April 28, 2019 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oterox/2dd71990b6b2ad070c119daa598fd7f7 to your computer and use it in GitHub Desktop.
Save oterox/2dd71990b6b2ad070c119daa598fd7f7 to your computer and use it in GitHub Desktop.
Cutom API class woocommerce
<?php
class WC_API_Custom extends WC_API_Resource {
protected $base = '/experiences';
public function register_routes( $routes ) {
$routes[ $this->base ] = array(
array( array( $this, 'get_experiences' ), WC_API_Server::READABLE )
);
return $routes;
}
public function get_experiences() {
return array( 'exp' => 'Data' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment