| @@ 42-54 (lines=13) @@ | ||
| 39 | */ |
|
| 40 | public function register_routes() { |
|
| 41 | ||
| 42 | if ( method_exists( $this, 'get' ) ) { |
|
| 43 | register_rest_route( |
|
| 44 | $this->namespace, |
|
| 45 | '/' . $this->rest_base, |
|
| 46 | array( |
|
| 47 | array( |
|
| 48 | 'methods' => 'GET', |
|
| 49 | 'callback' => array( $this, 'get_internal' ), |
|
| 50 | 'permission_callback' => array( $this, 'check_permission' ), |
|
| 51 | ), |
|
| 52 | ) |
|
| 53 | ); |
|
| 54 | } |
|
| 55 | ||
| 56 | if ( method_exists( $this, 'post' ) ) { |
|
| 57 | register_rest_route( |
|
| @@ 56-68 (lines=13) @@ | ||
| 53 | ); |
|
| 54 | } |
|
| 55 | ||
| 56 | if ( method_exists( $this, 'post' ) ) { |
|
| 57 | register_rest_route( |
|
| 58 | $this->namespace, |
|
| 59 | '/' . $this->rest_base, |
|
| 60 | array( |
|
| 61 | array( |
|
| 62 | 'methods' => 'POST', |
|
| 63 | 'callback' => array( $this, 'post_internal' ), |
|
| 64 | 'permission_callback' => array( $this, 'check_permission' ), |
|
| 65 | ), |
|
| 66 | ) |
|
| 67 | ); |
|
| 68 | } |
|
| 69 | ||
| 70 | if ( method_exists( $this, 'delete' ) ) { |
|
| 71 | register_rest_route( |
|
| @@ 70-82 (lines=13) @@ | ||
| 67 | ); |
|
| 68 | } |
|
| 69 | ||
| 70 | if ( method_exists( $this, 'delete' ) ) { |
|
| 71 | register_rest_route( |
|
| 72 | $this->namespace, |
|
| 73 | '/' . $this->rest_base, |
|
| 74 | array( |
|
| 75 | array( |
|
| 76 | 'methods' => 'DELETE', |
|
| 77 | 'callback' => array( $this, 'delete_internal' ), |
|
| 78 | 'permission_callback' => array( $this, 'check_permission' ), |
|
| 79 | ), |
|
| 80 | ) |
|
| 81 | ); |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|