-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfunctions.php
87 lines (73 loc) · 2.42 KB
/
functions.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
if (!get_option('quasarwp-settings')) {
add_option('quasarwp-settings', array(
'roboto-font' => 1,
'material-icons' => 1,
'fontawesomev5' => 1,
'language' => 'en-us',
'icon-set' => 'material',
));
}
add_action('admin_init', 'update_quasarwp');
function update_quasarwp()
{
register_setting('quasarwp-settings', 'quasarwp-settings');
}
include('assets/helpers.php');
include('components/custom-navs.php');
include('components/functions/setup.php');
add_filter('rest_allow_anonymous_comments', '__return_true');
add_theme_support('menus');
add_theme_support('post-thumbnails');
add_image_size('smallest', 300, 300, true);
add_image_size('largest', 800, 800, true);
register_nav_menus(
array(
'header-menu' => __('Header Menu', 'quasarwp'),
'footer-menu' => __('Footer Menu', 'quasarwp'),
'tab-menu' => __('Tab Menu', 'quasarwp'),
'left-menu' => __('Left Menu', 'quasarwp'),
'right-menu' => __('Right Menu', 'quasarwp'),
)
);
add_action('admin_menu', 'quasarwp_menu');
function quasarwp_menu() {
add_theme_page('QuasarWP Settings', 'QuasarWP Settings', 'manage_options', 'quasarwp', 'quasarwp_settings_page');
}
function quasarwp_settings_page()
{
if (!current_user_can('manage_options')) {
wp_die( esc_html(__('You do not have sufficient permissions to access this page.', 'quasarwp')) );
}
include('data/languages.php');
include('data/icon-sets.php');
$options = get_option('quasarwp-settings');
?>
<h1>QuasarWP Settings</h1>
<p><a href="<?php echo esc_html(get_site_url()) . '/wp-admin/customize.php'; ?>">Click here</a> to customize your theme.</p>
<form method="post" action="options.php">
<?php settings_fields('quasarwp-settings'); ?>
<?php do_settings_sections('quasarwp-settings'); ?>
<table class="form-table">
<tr>
<?php include('components/functions/modules.php'); ?>
</tr>
<tr>
<?php include('components/functions/language-pack.php'); ?>
</tr>
<tr>
<?php include('components/functions/icon-set.php'); ?>
</tr>
</table>
<?php submit_button(); ?>
</form>
<?php
}
// Customizer additions.
require get_template_directory() . '/inc/customizer.php';
function quasarwp_load_theme_textdomain()
{
load_theme_textdomain('quasarwp', get_template_directory() . '/languages');
}
add_action('after_setup_theme', 'quasarwp_load_theme_textdomain');
require_once('lib/TGM/quasarwp-components-activation.php');