-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhijri_calendar_admin.php
48 lines (35 loc) · 1.64 KB
/
hijri_calendar_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
<?php
add_action( 'admin_init', 'register_hijri_calendar_settings' );
add_action('admin_menu', 'register_hijri_calendar_menu_page');
define( 'HCAL_DOMAIN', 'hijri-calendar' );
function register_hijri_calendar_menu_page() {
add_menu_page('Hijri Calendar', 'Hijri Calendar', 'add_users', __FILE__, 'hijri_calendar_usage', plugins_url('hijri-calendar/images/icon.png'));
add_submenu_page(__FILE__, __('Usage', HCAL_DOMAIN ), __('Usage', HCAL_DOMAIN ), 'add_users', __FILE__, 'hijri_calendar_usage');
add_submenu_page(__FILE__, 'Settings', 'Settings', 'manage_options', 'hijri_calendar_settings', 'hijri_calendar_settings_page');
add_submenu_page(__FILE__, 'Server Information', 'Server Information', 'add_users', 'hijri_calendar_server_info', 'hijri_calendar_server_info_menu');
}
function register_hijri_calendar_settings() {
//register our settings
register_setting( 'hijri_calendar-settings-group', 'hcal_options' );
register_setting( 'hijri_calendar-settings-group', 'language_rplc' );
}
include "admin/sidebar.php";
function hijri_calendar_usage() {
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
include "admin/usage.php";
}
function hijri_calendar_settings_page() {
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
include "admin/settings.php";
}
function hijri_calendar_server_info_menu() {
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
include "admin/server_info.php";
}
?>