-
Notifications
You must be signed in to change notification settings - Fork 0
/
presets.php
52 lines (45 loc) · 1.3 KB
/
presets.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
46
47
48
49
50
51
52
<?php
/**
* Plugin Name: Presets
* Description: Fill your WordPress installation with previously defined settings in just a few seconds.
* Author: Presets contributors
* Author URI: https://github.com/felipelousantos/wp-presets/graphs/contributors
* Text Domain: presets
* Version: 2.1.1
*
* @package Presets
*/
require_once plugin_dir_path(__FILE__) . 'vendor/autoload.php';
use Presets\ {
Notes,
Taxonomy,
PostTypes,
Actions,
Triggers,
Modules
};
/**
* Function outputs the plugin directory with the root file name.
*
* @return string The plugin directory and root file name.
*/
function presets_plugin_filename() {
return str_replace(plugin_dir_path(__DIR__), '', $dir = plugin_dir_path(__FILE__)) . 'presets.php';
}
// Modules
new Modules\LoadModules();
// Objects creation
new Notes\Notes();
new Taxonomy\Tags();
new PostTypes\Presets();
new Actions\Fields();
new Actions\Implementation();
new Triggers\WPAdminBar();
/**
* Enqueue the plugin scripts and styles on admin.
*/
function presets_admin_scripts() {
wp_enqueue_style('presets_admin_css', plugin_dir_url(__FILE__) . 'assets/css/admin.css');
wp_enqueue_script('presets_admin_js', plugin_dir_url(__FILE__) . 'assets/js/admin.js');
}
add_action('admin_enqueue_scripts', 'presets_admin_scripts');