Server IP : 192.158.238.246 / Your IP : 52.15.220.116 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/jenniferflocom/www/wp-content/plugins/mstore-api/controllers/ |
Upload File : |
<?php require_once(__DIR__ . '/flutter-base.php'); require_once(__DIR__ . '/helpers/blog-helper.php'); /* * Base REST Controller for flutter * * @since 1.4.0 * * @package home */ class FlutterBlog extends FlutterBaseController { /** * Endpoint namespace * * @var string */ protected $namespace = 'api/flutter_blog'; public function __construct() { add_action('rest_api_init', array($this, 'register_flutter_blog_routes')); } public function register_flutter_blog_routes() { register_rest_route($this->namespace, '/blog/dynamic', array( array( 'methods' => "GET", 'callback' => array($this, 'get_blog_from_dynamic_link'), 'permission_callback' => function () { return parent::checkApiPermission(); } ), )); register_rest_route( $this->namespace, '/blog/create', array( array( 'methods' => "POST", 'callback' => array( $this, 'create_blog' ), 'permission_callback' => function () { return parent::checkApiPermission(); } ), )); register_rest_route( $this->namespace, '/blog/comment', array( array( 'methods' => "POST", 'callback' => array( $this, 'create_comment' ), 'permission_callback' => function () { return parent::checkApiPermission(); } ), )); } function get_blog_from_dynamic_link($request) { $helper = new FlutterBlogHelper(); return $helper->get_blog_from_dynamic_link($request); } function create_blog($request){ $helper = new FlutterBlogHelper(); return $helper->create_blog($request); } function create_comment($request){ $helper = new FlutterBlogHelper(); return $helper->create_comment($request); } } new FlutterBlog;