Last active
April 28, 2019 15:18
-
-
Save oterox/2dd71990b6b2ad070c119daa598fd7f7 to your computer and use it in GitHub Desktop.
Cutom API class woocommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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