-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start process of building a base endpoint for pressforward
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
namespace PressForward\Core\API; | ||
|
||
use Intraxia\Jaxion\Contract\Core\HasActions; | ||
use Intraxia\Jaxion\Contract\Core\HasFilters; | ||
|
||
use PressForward\Controllers\Metas; | ||
use WP_REST_Posts_Controller; | ||
|
||
use WP_Ajax_Response; | ||
|
||
class DiscoveryEndpoint extends WP_REST_Posts_Controller implements HasActions { | ||
|
||
protected $basename; | ||
|
||
function __construct( Metas $metas, $vendor, $api_version ){ | ||
$this->namespace = $vendor.'/'.$api_version; | ||
} | ||
|
||
|
||
public function action_hooks() { | ||
$actions = array( | ||
array( | ||
'hook' => 'rest_api_init', | ||
'method' => 'register_rest_namespace', | ||
) | ||
); | ||
return $actions; | ||
} | ||
|
||
public function register_rest_namespace(){ | ||
register_rest_route( $this->namespace, '/', array( 'test' => 'go' ) ); | ||
} | ||
|
||
|
||
} |
This file contains 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