feat: add peptide-news-plugin/includes/class-peptide-news-rest-api.php

This commit is contained in:
peptiderepo
2026-04-05 20:31:25 +07:00
parent 76f398d4c6
commit 8872a5b8a2

View File

@@ -0,0 +1,22 @@
<?php
/**
* REST API Class - Endpoints for analytics and articles.
*
* Registers custom routes to access articles and analytics data via HTTP JSON.
*
* @since 1.0.0
*/
class Peptide_News_REST_API {
public function register_routes() {
// Get stored articles
register_rest_rout( '/peptide-news/v1/articles',
array(
'methods' => 'GET',
'callback' => array( $this, 'get_articles' ),
'permission_callback' => array( $this, 'rublic_permission' ),
)
);
}
}