File: /home/karalev/www/wp-content/plugins/woolentor-addons/woolentor-blocks/includes/classes/Actions.php
<?php
namespace WooLentorBlocks;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Load general WP action hook
*/
class Actions {
/**
* [$_instance]
* @var null
*/
private static $_instance = null;
/**
* [instance] Initializes a singleton instance
* @return [Actions]
*/
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
/**
* The Constructor.
*/
public function __construct() {
add_action( 'rest_api_init', [ $this, 'register_api' ] );
}
/**
* Register Api
*/
public function register_api() {
$api = new Api\Api();
$api->register_routes();
}
}