-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
45 lines (37 loc) · 1.13 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
use NewfoldLabs\WP\Module\AI\AI;
use NewfoldLabs\WP\ModuleLoader\Container;
use function NewfoldLabs\WP\ModuleLoader\register;
if ( function_exists( 'add_action' ) ) {
add_action(
'plugins_loaded',
function () {
// Set Global Constants
if ( ! defined( 'NFD_MODULE_AI_DIR' ) ) {
define( 'NFD_MODULE_AI_DIR', __DIR__ );
}
if ( ! defined( 'NFD_AI_SERVICE_BASE' ) ) {
define( 'NFD_AI_SERVICE_BASE', 'https://hiive.cloud/workers/ai-proxy/v1/' );
define( 'NFD_AI_BASE', 'https://hiive.cloud/workers/ai-sitegen-proxy/' );
define( 'NFD_PATTERNS_BASE', 'https://patterns.hiive.cloud/' );
define( 'NFD_SITEGEN_OPTION', 'nfd-ai-site-gen' );
}
register(
array(
'name' => 'ai',
'label' => __( 'ai', 'newfold-ai-module' ),
'callback' => function ( Container $container ) {
return new AI( $container );
},
'isActive' => true,
'isHidden' => true,
)
);
// Register the custom command with WP_CLI
if ( defined( '\\WP_CLI' ) && \WP_CLI ) {
require_once __DIR__ . '/includes/NFD_CLI.php';
WP_CLI::add_command( 'newfold', 'NFD_CLI' );
}
}
);
}