PluginProbe
Customize Admin / 1.2
Customize Admin v1.2
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.6 1.6.6 1.7 1.7.4 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.2 1.8.4 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 All 29 releases
customize-admin / customize-admin.php

customize-admin.php in Customize Admin 1.2, at customize-admin.php

65 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Customize Admin
4 Plugin URI: http://www.vanderwijk.com/wordpress/customize-admin/
5 Description: This plugin allows you to customize the branding of the WordPress admin interface.
6 Version: 1.2
7 Author: Johan van der Wijk
8 Author URI: http://www.vanderwijk.com
9
10 Release notes: 1.2 Added the option to remove the shadow on the left menu which was introduced in WordPress 3.2
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26
27 // Title attribute for the logo on the login screen
28 function ca_logo_title($message) {
29 if (get_option('ca_logo_url') != '')
30 printf(__("Go to %s"), get_option('ca_logo_url'));
31 else
32 printf(__("Return to %s"), get_bloginfo('name'));
33 }
34
35 // URL for the logo on the login screen
36 function ca_logo_url($url) {
37 if (get_option('ca_logo_url') != '')
38 return get_option('ca_logo_url');
39 else
40 return get_bloginfo('siteurl');
41 }
42
43 // CSS for custom logo on the login screen
44 function ca_logo_file() {
45 if (get_option('ca_logo_file') != '')
46 echo '<style>h1 a { background-image:url("' . get_option('ca_logo_file') . '")!important; }</style>';
47 else
48 $stylesheet_uri = get_bloginfo('siteurl') . '/' . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__)) . '/customize-admin.css';
49 echo '<link rel="stylesheet" type="text/css" href="' . $stylesheet_uri . '" />';
50 }
51
52 // Remove the shadow from the left menu
53 function ca_add_styles() {
54 if (get_option('ca_remove_shadow') != '')
55 echo '<style type="text/css">#adminmenushadow, #adminmenuback { background-image: none; }</style>';
56 }
57
58 add_filter('login_headertitle', 'ca_logo_title');
59 add_filter('login_headerurl', 'ca_logo_url');
60 add_action('login_head', 'ca_logo_file');
61 add_action('admin_head', 'ca_add_styles');
62
63 require_once('customize-admin-options.php');
64
65 ?>