Skip to content

Commit

Permalink
add endpoint to get slider by name
Browse files Browse the repository at this point in the history
matheusgimenez committed Dec 12, 2016
1 parent 319e54f commit 15e3265
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inc/rest-api-class.php
Original file line number Diff line number Diff line change
@@ -18,7 +18,11 @@ public function __construct() {
add_action( 'rest_api_init', array( &$this, 'rest_api_init' ) );
}
public function rest_api_init() {
register_rest_route( 'brasa-slider', '/(?P<slider>[a-zA-Z0-9-]+)', array(
register_rest_route( 'brasa-slider', '/id/(?P<slider>\d+)', array(
'methods' => 'GET',
'callback' => array( &$this, 'endpoint' )
) );
register_rest_route( 'brasa-slider', '/name', array(
'methods' => 'GET',
'callback' => array( &$this, 'endpoint' )
) );

0 comments on commit 15e3265

Please sign in to comment.