. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 87.98.249.37 / Your IP : 216.73.216.208 [ Web Server : Microsoft-IIS/10.0 System : Windows NT NS3076740 10.0 build 17763 (Windows Server 2019) AMD64 User : IWPD_292(growel19p) ( 0) PHP Version : 8.3.12 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Inetpub/vhosts/growel.com/httpdocs/blog/wp-content/plugins/firebox/Inc/Framework/Inc/API/ |
Upload File : |
<?php
/**
* @package FirePlugins Framework
* @version 1.1.142
*
* @author FirePlugins <info@fireplugins.com>
* @link https://www.fireplugins.com
* @copyright Copyright © 2025 FirePlugins All Rights Reserved
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/
namespace FPFramework\API;
if (!defined('ABSPATH'))
{
exit; // Exit if accessed directly.
}
class API
{
public function __construct()
{
add_action( 'rest_api_init', [$this, 'register_routes'] );
}
/**
* Register all found routes
*
* @return void
*/
public function register_routes()
{
// find all routes
$routes = array_diff( scandir( __DIR__ . '/Routes' ), [ '.', '..', 'index.php' ] );
foreach ($routes as $route)
{
$route = str_replace('.php', '', $route);
$class = '\FPFramework\API\Routes\\' . $route;
$api = new $class($this);
$api->register();
}
}
}