File tree 2 files changed +57
-1
lines changed
2 files changed +57
-1
lines changed Original file line number Diff line number Diff line change 29
29
require plugin_dir_path ( __FILE__ ) . 'class-gwiz-gf-openai.php ' ;
30
30
31
31
GFAddOn::register ( 'GWiz_GF_OpenAI ' );
32
- }, 5 );
32
+ }, 0 ); // Load before Gravity Flow
33
+
34
+ /*
35
+ * Gravity Flow compatibility.
36
+ */
37
+ add_action ( 'gravityflow_loaded ' , function () {
38
+ require_once ( gwiz_gf_openai ()->get_base_path () . '/includes/class-gravity-flow-step-feed-gwiz-gf-openai.php ' );
39
+
40
+ Gravity_Flow_Steps::register ( new Gravity_Flow_Step_Feed_GWiz_GF_OpenAI () );
41
+ } );
33
42
34
43
/**
35
44
* Returns an instance of the GWiz_GF_OpenAI class
Original file line number Diff line number Diff line change
1
+ <?php
2
+ defined ( 'ABSPATH ' ) || die ();
3
+
4
+ class Gravity_Flow_Step_Feed_GWiz_GF_OpenAI extends Gravity_Flow_Step_Feed_Add_On {
5
+ /**
6
+ * The step type.
7
+ *
8
+ * @var string
9
+ */
10
+ public $ _step_type = 'gwiz_gf_openai ' ;
11
+
12
+ /**
13
+ * The name of the class used by the add-on.
14
+ *
15
+ * @var string
16
+ */
17
+ protected $ _class_name = 'GWiz_GF_OpenAI ' ;
18
+
19
+ /**
20
+ * Returns the step label.
21
+ *
22
+ * @return string
23
+ */
24
+ public function get_label () {
25
+ return 'OpenAI ' ;
26
+ }
27
+
28
+ /**
29
+ * Returns the step icon.
30
+ */
31
+ public function get_icon_url () {
32
+ return gwiz_gf_openai ()->get_base_url () . '/icon.svg ' ;
33
+ }
34
+
35
+ /**
36
+ * Returns the feed name.
37
+ *
38
+ * @param array $feed The Emma feed properties.
39
+ *
40
+ * @return string
41
+ */
42
+ public function get_feed_label ( $ feed ) {
43
+ $ label = $ feed ['meta ' ]['feed_name ' ];
44
+
45
+ return $ label ;
46
+ }
47
+ }
You can’t perform that action at this time.
0 commit comments