| 1 |
<?php |
| 2 |
/** |
| 3 |
* Initialize Automation REST API |
| 4 |
* |
| 5 |
* @package WPFunnels |
| 6 |
* @since 3.9.5 |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace WPFunnels\Modules\Admin\Automations; |
| 10 |
|
| 11 |
use WPFunnels\Rest\Controllers\AutomationController; |
| 12 |
|
| 13 |
/** |
| 14 |
* Initialize REST API for Automations |
| 15 |
*/ |
| 16 |
function init_automation_rest_api() |
| 17 |
{ |
| 18 |
// Register REST API controller |
| 19 |
add_action('rest_api_init', function () { |
| 20 |
// Load the controller file |
| 21 |
require_once WPFNL_DIR . '/includes/core/rest-api/Controllers/class-automation-controller.php'; |
| 22 |
|
| 23 |
$controller = new AutomationController(); |
| 24 |
$controller->register_routes(); |
| 25 |
}); |
| 26 |
} |
| 27 |
|
| 28 |
add_action('init', __NAMESPACE__ . '\init_automation_rest_api'); |
| 29 |
|