@airfleet/generator-init 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# <%= answers.npmTitle %>
|
|
2
2
|
|
|
3
|
-

|
|
3
|
+
[](https://www.npmjs.com/package/<%= packageName %>)
|
|
4
4
|
[](<%= repositoryBase %>/-/commits/main)
|
|
5
5
|
|
|
6
6
|
<%= answers.npmDescription %>
|
|
@@ -14,26 +14,35 @@ class Setup {
|
|
|
14
14
|
add_action(
|
|
15
15
|
'airfleet/init',
|
|
16
16
|
function () {
|
|
17
|
-
|
|
18
|
-
[
|
|
19
|
-
'slug' => '<%= name.slug %>',
|
|
20
|
-
'title' => '<%= name.title %>',
|
|
21
|
-
'short_title' => '<%= nameNoAirfleet.title %>',
|
|
22
|
-
'url' => \<%= name.constant %>_URL,
|
|
23
|
-
'path' => \<%= name.constant %>_PATH,
|
|
24
|
-
'version' => \<%= name.constant %>_VERSION,
|
|
25
|
-
]
|
|
26
|
-
);
|
|
27
|
-
$plugin->setup_acf_json();
|
|
28
|
-
$plugin->enqueue();
|
|
29
|
-
$plugin->enqueue_admin();
|
|
30
|
-
<%_ if (answers.pluginCreateOptions) { _%>
|
|
31
|
-
$plugin->add_options_page();
|
|
32
|
-
<%_ } _%>
|
|
17
|
+
$this->plugin_basic_setup();
|
|
33
18
|
}
|
|
34
19
|
);
|
|
35
20
|
}
|
|
36
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Basic setup for the plugin. Enqueue assets and add options page
|
|
24
|
+
*
|
|
25
|
+
* @return void
|
|
26
|
+
*/
|
|
27
|
+
public function plugin_basic_setup(): void {
|
|
28
|
+
$plugin = new \Airfleet\Plugin(
|
|
29
|
+
[
|
|
30
|
+
'slug' => '<%= name.slug %>',
|
|
31
|
+
'title' => '<%= name.title %>',
|
|
32
|
+
'short_title' => '<%= nameNoAirfleet.title %>',
|
|
33
|
+
'url' => \<%= name.constant %>_URL,
|
|
34
|
+
'path' => \<%= name.constant %>_PATH,
|
|
35
|
+
'version' => \<%= name.constant %>_VERSION,
|
|
36
|
+
]
|
|
37
|
+
);
|
|
38
|
+
$plugin->setup_acf_json();
|
|
39
|
+
$plugin->enqueue();
|
|
40
|
+
$plugin->enqueue_admin();
|
|
41
|
+
<%_ if (answers.pluginCreateOptions) { _%>
|
|
42
|
+
$plugin->add_options_page();
|
|
43
|
+
<%_ } _%>
|
|
44
|
+
}
|
|
45
|
+
|
|
37
46
|
/**
|
|
38
47
|
* Show and admin notification if the Airfleet Framework plugin is not enabled.
|
|
39
48
|
*
|
|
@@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
|
26
26
|
die;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
// Plugin
|
|
29
|
+
// Plugin constants.
|
|
30
30
|
define( '<%= name.constant %>_VERSION', '<%= answers.pluginVersion %>' );
|
|
31
31
|
define( '<%= name.constant %>_PATH', plugin_dir_path( __FILE__ ) );
|
|
32
32
|
define( '<%= name.constant %>_URL', plugin_dir_url( __FILE__ ) );
|