PluginProbe
Customize Admin / 1.5.1
Customize Admin v1.5.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.5.1, at customize-admin.php

130 lines 4.7 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 appearance and branding of the WordPress admin interface.
6 Version: 1.5.1
7 Author: Johan van der Wijk
8 Author URI: http://www.vanderwijk.com
9
10 Release notes: 1.5.1 Changed get_bloginfo( 'siteurl' ) to get_bloginfo( 'url' ) to prevent debug notices
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() {
29 if ( get_option( 'ca_logo_url' ) != '' ) {
30 return sprintf ( __( 'Go to %1$s' ), get_option ( 'ca_logo_url' ) );
31 }
32 }
33
34 // URL for the logo on the login screen
35 function ca_logo_url($url) {
36 if ( get_option( 'ca_logo_url' ) != '') {
37 return get_option( 'ca_logo_url' );
38 } else {
39 return get_bloginfo( 'url' );
40 }
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; background-size:auto!important; }</style>';
47 } else {
48 $stylesheet_uri = get_bloginfo( 'url' ) . '/' . PLUGINDIR . '/' . dirname( plugin_basename(__FILE__) ) . '/customize-admin.css';
49 echo '<link rel="stylesheet" type="text/css" href="' . $stylesheet_uri . '" />';
50 }
51 }
52
53 // Remove the shadow from the left menu
54 function ca_add_styles() {
55 if ( get_option( 'ca_remove_shadow' ) != '' ) {
56 echo '<style type="text/css">#adminmenushadow, #adminmenuback { background-image: none; }</style>';
57 }
58 }
59
60 // Remove the generator meta tag
61 function ca_remove_meta_generator() {
62 if ( get_option( 'ca_remove_meta_generator' ) != '' ) {
63 remove_action( 'wp_head', 'wp_generator' );
64 }
65 }
66
67 // Remove the RSD meta tag
68 function ca_remove_meta_rsd() {
69 if ( get_option( 'ca_remove_meta_rsd' ) != '' ) {
70 remove_action('wp_head', 'rsd_link');
71 }
72 }
73
74 // Remove the WLW meta tag
75 function ca_remove_meta_wlw() {
76 if ( get_option( 'ca_remove_meta_wlw' ) != '' ) {
77 remove_action('wp_head', 'wlwmanifest_link');
78 }
79 }
80
81 // Remove Quick Press widget from dashboard
82 function ca_remove_dashboard_quick_press() {
83 if ( get_option( 'ca_remove_dashboard_quick_press' ) != '' ) {
84 remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
85 }
86 }
87
88 // Remove Plugins widget from dashboard
89 function ca_remove_dashboard_plugins() {
90 if ( get_option( 'ca_remove_dashboard_plugins' ) != '' ) {
91 remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
92 }
93 }
94
95 // Remove Recent Comments widget from dashboard
96 function ca_remove_dashboard_recent_comments() {
97 if ( get_option( 'ca_remove_dashboard_recent_comments' ) != '' ) {
98 remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
99 }
100 }
101
102 // Remove WordPress Site News widget from dashboard
103 function ca_remove_dashboard_wordpress_news() {
104 if ( get_option( 'ca_remove_dashboard_wordpress_news' ) != '' ) {
105 remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
106 }
107 }
108
109 // Remove WordPress Other News widget from dashboard
110 function ca_remove_dashboard_wordpress_other() {
111 if ( get_option( 'ca_remove_dashboard_wordpress_other' ) != '' ) {
112 remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
113 }
114 }
115
116 add_filter( 'login_headertitle', 'ca_logo_title' );
117 add_filter( 'login_headerurl', 'ca_logo_url' );
118 add_action( 'login_head', 'ca_logo_file' );
119 add_action( 'admin_head', 'ca_add_styles' );
120 add_action( 'init', 'ca_remove_meta_generator' );
121 add_action( 'init', 'ca_remove_meta_rsd' );
122 add_action( 'init', 'ca_remove_meta_wlw' );
123 add_action( 'wp_dashboard_setup', 'ca_remove_dashboard_quick_press' );
124 add_action( 'wp_dashboard_setup', 'ca_remove_dashboard_plugins' );
125 add_action( 'wp_dashboard_setup', 'ca_remove_dashboard_recent_comments' );
126 add_action( 'wp_dashboard_setup', 'ca_remove_dashboard_wordpress_news' );
127 add_action( 'wp_dashboard_setup', 'ca_remove_dashboard_wordpress_other' );
128
129 require_once( 'customize-admin-options.php' );
130 ?>