1 <?php
2
3 /**
4 * Vanilla /wp-admin related enhancements.
5 *
6 * @author Nevma, http://www.nevma.gr, info@nevma.gr
7 *
8 * @license http://www.gnu.org/licenses/gpl-3.0.en.html GPLv3
9 */
10
11
12
13 /**
14 * Set favicon for the admin and login area.
15 *
16 * @return void
17 */
18
19 function vanilla_admin_favicon () {
20
21 $favicon_path = get_template_directory_uri() . '/img/favicons/favicon.ico'; ?>
22
23 <link rel = "shortcut icon" href = "<?php echo $favicon_path; ?>" /> <?php
24
25 }
26
27
28
29 /**
30 * Fix various admin CSS stylings.
31 *
32 * @return void
33 */
34
35 function vanilla_admin_css () {
36
37 wp_enqueue_style( 'vanilla-wordpress-admin', get_template_directory_uri() . '/inc/vanilla/base/css/vanilla.admin.css', false );
38
39 }
40
41
42
43 /**
44 * Sets the login screen logos to show the website logo and the Nevma logo.
45 *
46 * @return void
47 */
48
49 function vanilla_admin_login_page_css () {
50
51 wp_enqueue_style( 'vanilla-wordpress-login', get_template_directory_uri() . '/inc/vanilla/base/css/vanilla.login.css', false );
52
53 }
54
55
56
57 /**
58 * Sets the login screen link url to point to the home page.
59 *
60 * @return string The home url.
61 */
62
63 function vanilla_admin_login_page_link () {
64
65 return home_url();
66
67 }
68
69
70
71 /**
72 * Sets the login screen title text to the website title.
73 *
74 * @return string The blog name.
75 */
76
77 function vanilla_admin_login_page_link_title() {
78
79 return get_bloginfo( 'name' ); ;
80
81 }
82
83
84
85 /**
86 * Add SVGs to the list of allowed mime types.
87 *
88 * @param array $upload_mimes The existing allowed mime types.
89 *
90 * @return array The enhanced allowed mime types.
91 */
92
93 function vanilla_admin_add_svg_to_upload_mimes( $upload_mimes ) {
94
95 $upload_mimes['svg'] = 'image/svg+xml';
96 $upload_mimes['svgz'] = 'image/svg+xml';
97
98 return $upload_mimes;
99
100 }
101
102 ?>