PluginProbe
Customize Admin / 1.1
Customize Admin v1.1
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.1, at customize-admin.php

58 lines 2.2 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.1
7 Author: Johan van der Wijk
8 Author URI: http://www.vanderwijk.com
9
10 Release notes: 1.1 Minor update
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 require_once('customize-admin-options.php');
28
29 add_action('login_head', 'custom_login_logo', 99);
30 add_filter('login_headerurl', 'custom_login_logo_url');
31 add_filter('login_headertitle', 'custom_login_logo_title');
32
33 /* Title attribute for the logo on the login screen */
34 function custom_login_logo_title($message) {
35 if (get_option('custom_admin_logo_link') != '')
36 printf(__("Go to %s"), get_option('custom_admin_logo_link'));
37 else
38 printf(__("Return to %s"), get_bloginfo('name'));
39 }
40
41 /* URL for the logo on the login screen */
42 function custom_login_logo_url($url) {
43 if (get_option('custom_admin_logo_link') != '')
44 return get_option('custom_admin_logo_link');
45 else
46 return get_bloginfo('siteurl');
47 }
48
49 /* CSS for custom logo on the login screen */
50 function custom_login_logo() {
51 if (get_option('custom_admin_logo_file_location') != '')
52 echo '<style>h1 a { background-image:url("' . get_option('custom_admin_logo_file_location') . '")!important; }</style>';
53 else
54 $stylesheet_uri = get_bloginfo('siteurl') . '/' . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__)) . '/customize-admin.css';
55 echo '<link rel="stylesheet" type="text/css" href="' . $stylesheet_uri . '" />';
56 }
57
58 ?>