golden hour
/home/godaofbq/hyperxmed.com/wp-content/plugins/essential-blocks/includes/API
⬆️ Go Up
Upload
File/Folder
Size
Actions
Base.php
1.03 KB
Del
OK
PostBlock.php
4.11 KB
Del
OK
Product.php
16.09 KB
Del
OK
Server.php
501 B
Del
OK
error_log
17.69 KB
Del
OK
Edit: Base.php
<?php namespace EssentialBlocks\API; use WP_REST_Server; use EssentialBlocks\Traits\HasSingletone; abstract class Base { use HasSingletone; /** * Register REST Routes * * @return void */ abstract function register(); public function register_endpoint( $endpoint, $args = [] ) { register_rest_route( 'essential-blocks/v1', $endpoint, $args ); } public function get( $endpoint, $args = [] ) { $_args = wp_parse_args( $args, [ 'methods' => WP_REST_Server::READABLE, 'permission_callback' => '__return_true' ] ); $this->register_endpoint( $endpoint, $_args ); } public function post( $endpoint, $args = [] ) { $_args = wp_parse_args( $args, [ 'methods' => WP_REST_Server::CREATABLE, 'permission_callback' => '__return_true' ] ); $this->register_endpoint( $endpoint, $_args ); } }
Save