-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass.big-magic-ai.php
More file actions
38 lines (31 loc) · 1.13 KB
/
class.big-magic-ai.php
File metadata and controls
38 lines (31 loc) · 1.13 KB
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
<?php
class BigMagicAI {
private static $initiated = false;
public static function init() {
if ( ! self::$initiated ) {
self::init_hooks();
}
}
/**
* Initializes WordPress hooks
*/
private static function init_hooks() {
self::$initiated = true;
// @TODO unsure why this isn't working
// add_action( 'init', 'create_bigmagicai_block' );
}
public static function get_api_key() {
return apply_filters( 'bigmagicai_get_api_key', get_option('bigmagicai_plugin_options')['openai_api_key'] );
}
/**
* Registers a block type:
* The recommended way is to register a block type using the metadata stored in the block.json file
* https://developer.wordpress.org/reference/functions/register_block_type/
*/
public static function create_bigmagicai_block() {
register_block_type( plugin_dir_path( __FILE__ ) . 'build/correct-english-grammar/' );
register_block_type( plugin_dir_path( __FILE__ ) . 'build/generate-content/' );
register_block_type( plugin_dir_path( __FILE__ ) . 'build/generate-image/' );
register_block_type( plugin_dir_path( __FILE__ ) . 'build/translate/' );
}
}