forked from GuyPrimavera/aquila-admin-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.php
65 lines (56 loc) · 2.64 KB
/
scripts.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
<?php
if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) {
exit;
}
// Global scripts
function aquila_global_load_style() {
if ( is_admin_bar_showing() ) {
global $aquilaVer;
wp_enqueue_script( "jquery" );
wp_register_style( 'aquila-admin-icons', plugins_url( 'aquila-admin-theme/icons/style.css' ), array(), $aquilaVer );
wp_enqueue_style( 'aquila-admin-icons' );
wp_register_style( 'aquila-adminBar-style', plugins_url( 'aquila-admin-theme/css/adminBar.css' ), array(), $aquilaVer );
wp_enqueue_style( 'aquila-adminBar-style' );
wp_register_style( 'aquila-table-style', plugins_url( 'aquila-admin-theme/css/table.css' ), array(), $aquilaVer );
wp_enqueue_style( 'aquila-table-style' );
wp_register_script( 'aquilaCalls', plugins_url( '/js/calls.js', __FILE__ ), array( 'jquery' ), filemtime( plugin_dir_path( __FILE__ ) . 'js/calls.js' ), true );
wp_enqueue_script( 'aquilaCalls' );
}
}
add_action( 'admin_enqueue_scripts', 'aquila_global_load_style' );
add_action( 'wp_head', 'aquila_global_load_style', 99 );
add_action( 'login_enqueue_scripts', 'aquila_global_load_style' );
// Admin scripts
function aquila_admin_load_style() {
global $aquilaVer;
wp_register_style( 'aquila-admin-style', plugins_url( 'aquila-admin-theme/css/aquila.css' ), array(), $aquilaVer );
wp_register_style( 'aquila-admin-style', plugins_url( 'aquila-admin-theme/css/aquila.css' ), array(), $aquilaVer );
wp_enqueue_style( 'aquila-admin-style' );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker' );
if ( function_exists( 'wp_enqueue_media' ) ) {
wp_enqueue_media();
} else {
wp_enqueue_style( 'thickbox' );
wp_enqueue_script( 'media-upload' );
wp_enqueue_script( 'thickbox' );
}
}
add_action( 'admin_enqueue_scripts', 'aquila_admin_load_style', 99 );
// Login scripts
function aquila_login_load_style() {
global $aquilaVer;
wp_register_style( 'aquila-admin-icons', plugins_url( 'aquila-admin-theme/icons/style.css' ), array(), $aquilaVer );
wp_enqueue_style( 'aquila-admin-icons' );
wp_register_style( 'aquila-login-style', plugins_url( 'aquila-admin-theme/css/login.css' ), array(), $aquilaVer );
wp_enqueue_style( 'aquila-login-style' );
}
add_action( 'login_enqueue_scripts', 'aquila_login_load_style' );
// i18n
function aquila_i18n_setup() {
$locale = apply_filters( 'plugin_locale', get_locale(), 'aquila-admin-theme' );
load_textdomain( 'aquila-admin-theme', WP_LANG_DIR . "/aquila-admin-theme-$locale.mo" );
load_plugin_textdomain( 'aquila-admin-theme', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
}
add_action( 'plugins_loaded', 'aquila_i18n_setup' );
?>