-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathadmin.php
executable file
·61 lines (52 loc) · 1.31 KB
/
admin.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
53
54
55
56
57
58
59
60
61
<?php
/**
* Defining admin page of flexia
*/
class Flexia_Admin
{
protected $theme;
protected $installer;
public function __construct()
{
// load files
$this->load_files();
// init vars
$this->theme = wp_get_theme();
$this->installer = new Flexia_Plugin_Installer();
// actions
add_action('admin_menu', array($this, 'flexia_admin_menu'));
add_action('admin_enqueue_scripts', array($this, 'flexia_admin_enqueue_scripts'));
}
/**
* Load required files.
*
* @since 1.0.4
*/
protected function load_files()
{
require_once get_template_directory() . '/admin/plugin-installer.php';
}
/**
* Register the stylesheets for the admin area.
*
* @since 1.0.4
*/
public function flexia_admin_enqueue_scripts()
{
wp_enqueue_style('flexia', get_template_directory_uri() . '/admin/css/flexia-admin.css', array(), $this->theme->version);
}
/**
* Create Dashboard Pages
*
* @since 1.0.4
*/
public function flexia_admin_menu()
{
if( !class_exists('Flexia_Pro') ) {
add_theme_page( 'Flexia', 'Flexia Settings', 'edit_theme_options', 'flexia-options', 'flexia_dashboard_page' );
}
else {
do_action('flexia_theme_admin_menu', $this);
}
}
}