Skip to content

Commit e31cbd2

Browse files
committed
Add an abstract register_rest_endpoint method to enforce its use
1 parent 1933f7b commit e31cbd2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

classes/rest/class-base.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ public function __construct() {
1919
\add_action( 'rest_api_init', [ $this, 'register_rest_endpoint' ] );
2020
}
2121

22+
/**
23+
* Register REST endpoint.
24+
*
25+
* Child classes must implement this method to define their REST endpoints.
26+
*
27+
* @return void
28+
*/
29+
abstract public function register_rest_endpoint();
30+
2231
/**
2332
* Get client IP address.
2433
*

0 commit comments

Comments
 (0)