Add Logo to Admin - Version 1.5

Version Description

Download this release

Release Info

Developer tinkerpriest
Plugin Icon wp plugin Add Logo to Admin
Version 1.5
Comparing to
See all releases

Code changes from version 1.6 to 1.5

add-logo-to-admin.php DELETED
@@ -1,256 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Add Logo to Admin
4
- Plugin URI: http://bavotasan.com/2011/add-your-logo-to-the-wordpress-admin-and-login-page/
5
- Description: Adds a custom logo to your wp-admin and login page.
6
- Author: c.bavota
7
- Version: 1.6
8
- Author URI: http://bavotasan.com
9
- Text Domain: add-logo
10
- Domain Path: /languages
11
- License: GPL2
12
- */
13
-
14
- /* Copyright 2014 c.bavota (email : cbavota@gmail.com)
15
-
16
- This program is free software; you can redistribute it and/or modify
17
- it under the terms of the GNU General Public License, version 2, as
18
- published by the Free Software Foundation.
19
-
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
-
25
- You should have received a copy of the GNU General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
- */
29
-
30
- // Plugin version
31
- if ( ! defined( 'ADD_LOGO_VERSION' ) ) {
32
- define( 'ADD_LOGO_VERSION', '1.6' );
33
- }
34
-
35
- if ( ! class_exists( 'WP_Add_Logo_To_Admin' ) ) {
36
- class WP_Add_Logo_To_Admin {
37
- /**
38
- * Construct the plugin object
39
- */
40
- public function __construct() {
41
- $plugin_options = get_option( 'wp_add_logo_to_admin' );
42
-
43
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
44
- add_action( 'admin_init', array( $this, 'admin_init' ) );
45
- add_action( 'admin_menu', array( $this, 'admin_menu' ) );
46
-
47
- if ( 'on' == $plugin_options['login'] ) {
48
- add_action( 'login_enqueue_scripts', array( $this, 'login_enqueue_scripts' ) );
49
- add_filter( 'login_headertitle', array( $this, 'login_headertitle' ) );
50
- add_filter( 'login_headerurl', array( $this, 'login_headerurl' ) );
51
- }
52
-
53
- }
54
-
55
- public function admin_init() {
56
- register_setting( 'wp_add_logo_to_admin', 'wp_add_logo_to_admin', array( $this, 'wp_add_logo_to_admin_validation' ) );
57
-
58
- load_plugin_textdomain( 'add-logo', null, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
59
- }
60
-
61
- /**
62
- * Validation
63
- *
64
- * @since 1.6
65
- */
66
- public function wp_add_logo_to_admin_validation( $input ) {
67
- $input['login'] = ( empty( $input['login'] ) ) ? '' : 'on';
68
- $input['admin'] = ( empty( $input['admin'] ) ) ? '' : 'on';
69
- $input['image'] = esc_url( $input['image'] );
70
-
71
- return $input;
72
- }
73
-
74
- public function admin_menu() {
75
- add_options_page( __( 'Add Logo to Admin', 'add-logo' ), __( 'Add Logo to Admin', 'add-logo' ), 'manage_options', __FILE__, array( $this, 'add_logo_options_page' ) );
76
- }
77
-
78
- /**
79
- * Custom login logo URL
80
- *
81
- * This function is attached to the 'login_headerurl' filter hook.
82
- *
83
- * @since 1.6
84
- */
85
- public function login_headerurl() {
86
- return esc_url( home_url() );
87
- }
88
-
89
- /**
90
- * Custom login logo URL title
91
- *
92
- * This function is attached to the 'login_headertitle' filter hook.
93
- *
94
- * @since 1.6
95
- */
96
- public function login_headertitle() {
97
- return esc_attr( get_bloginfo( 'name' ) );
98
- }
99
-
100
- /**
101
- * Custom login screen
102
- *
103
- * This function is attached to the 'login_enqueue_scripts' filter hook.
104
- *
105
- * @since 1.6
106
- */
107
- function login_enqueue_scripts() {
108
- $plugin_options = get_option( 'wp_add_logo_to_admin' );
109
- if ( $image = $plugin_options['image' ] ) { ?>
110
- <style>
111
- body.login div#login h1 a {
112
- background-image: url(<?php echo esc_url( $image ); ?>);
113
- background-size: contain;
114
- width: 100%;
115
- }
116
- </style>
117
- <?php
118
- }
119
- }
120
-
121
- /**
122
- * Create the add logo to admin page
123
- *
124
- * This function is referenced in 'add_options_page()'.
125
- *
126
- * @since 1.6
127
- */
128
- public function add_logo_options_page() {
129
- if ( ! current_user_can( 'manage_options' ) )
130
- wp_die( __( 'You do not have sufficient permissions to access this page.', 'add-logo' ) );
131
-
132
- $plugin_options = get_option( 'wp_add_logo_to_admin' );
133
- $image = ( $plugin_options['image'] ) ? '<img src="' . esc_url( $plugin_options['image'] ) . '" alt="" style="max-width: 100%;" />' : '';
134
- $display = ( $plugin_options['image'] ) ? '' : 'style="display: none;"';
135
- ?>
136
- <div class="wrap">
137
- <h2><?php _e( 'Add Logo to Admin', 'add-logo' ); ?></h2>
138
- <!-- Add Logo to Admin box begin-->
139
- <form method="post" action="options.php">
140
- <?php settings_fields( 'wp_add_logo_to_admin' ); ?>
141
-
142
- <table id="add-logo-table" class="form-table">
143
- <tr valign="top">
144
- <th scope="row"><?php _e( 'Logo Options', 'add-logo' ); ?></th>
145
- <td>
146
- <fieldset>
147
- <label for="add-logo-on-login">
148
- <input name="wp_add_logo_to_admin[login]" id="add-logo-on-login" type="checkbox" <?php checked( esc_attr( $plugin_options['login'] ), 'on' ); ?>>
149
- <?php _e( 'Display logo on the login page', 'add-logo' ); ?></label>
150
- <br />
151
- <label for="add-logo-on-admin">
152
- <input name="wp_add_logo_to_admin[admin]" id="add-logo-on-admin" type="checkbox" <?php checked( esc_attr( $plugin_options['admin'] ), 'on' ); ?>>
153
- <?php _e( 'Display logo on all admin pages', 'add-logo' ); ?></label>
154
- </fieldset>
155
- </td>
156
- </tr>
157
- <tr valign="top">
158
- <th scope="row"><?php _e( 'Upload Logo', 'add-logo' ); ?></th>
159
- <td>
160
- <input type="hidden" id="add-logo-image" name="wp_add_logo_to_admin[image]" value="<?php echo esc_url( $plugin_options['image'] ); ?>" />
161
- <div id="add-logo-image-container"><?php echo $image; ?></div>
162
- <a href="#" class="select-image"><?php _e( 'Select image', 'add-logo' ); ?></a>&nbsp;&nbsp;&nbsp;<a href="#" class="delete-image" <?php echo $display; ?>><?php _e( 'Delete image', 'add-logo' ); ?></a>
163
- <br />
164
- <p class="description"><?php _e( 'Your logo should be no larger than 320px by 80px or else it will be resized on the login screen.', 'add-logo' ); ?></p>
165
- </td>
166
- </tr>
167
- </table>
168
-
169
- <?php submit_button(); ?>
170
- </form>
171
- <!-- Add Logo to Admin admin box end-->
172
- </div>
173
- <?php
174
- }
175
-
176
- /**
177
- * Set up the default options on activation
178
- *
179
- * This functions is referenced in 'register_activation_hook()'
180
- *
181
- * @since 1.6
182
- */
183
- public static function activate() {
184
- $default_option = array(
185
- 'login' => 'on',
186
- 'admin' => 'on',
187
- 'image' => plugins_url( 'images/logo.png', __FILE__ )
188
- );
189
-
190
- add_option( 'wp_add_logo_to_admin', $default_option );
191
- }
192
-
193
- /**
194
- * Remove all options on deactivation
195
- *
196
- * This functions is referenced in 'register_deactivation_hook()'
197
- *
198
- * @since 1.6
199
- */
200
- public static function deactivate() {
201
- delete_option( 'wp_add_logo_to_admin' );
202
- }
203
-
204
- /**
205
- * Initialization of the plugin which creates the admin page
206
- *
207
- * This functions is attached to the 'admin_enqueue_scripts' action hook
208
- *
209
- * @since 1.6
210
- */
211
- public function admin_enqueue_scripts( $hook ) {
212
- $plugin_options = get_option( 'wp_add_logo_to_admin' );
213
-
214
- if ( 'settings_page_add-logo-to-admin/add-logo-to-admin' == $hook ) {
215
- wp_enqueue_media();
216
- wp_enqueue_script( 'add_logo_to_admin', plugins_url( 'js/add-logo-select-image.js', __FILE__ ), array( 'jquery', 'media-upload', 'media-views' ), ADD_LOGO_VERSION, true );
217
- }
218
-
219
- if ( 'on' == $plugin_options['admin'] ) {
220
- wp_enqueue_script( 'add_logo_jquery', plugins_url( 'js/add-logo.js', __FILE__ ), array( 'jquery' ), ADD_LOGO_VERSION, true );
221
- wp_localize_script( 'add_logo_jquery', 'add_logo_image', esc_url( $plugin_options['image'] ) );
222
- wp_enqueue_style( 'add_logo_to_admin', plugins_url( 'css/add-logo.css', __FILE__ ), '', ADD_LOGO_VERSION );
223
- }
224
- }
225
-
226
- } // END class WP_Plugin_Template
227
- }
228
-
229
- if ( class_exists( 'WP_Add_Logo_To_Admin' ) ) {
230
- /**
231
- * Installing the activation and deactivation hooks
232
- *
233
- * @since 1.6
234
- */
235
- register_activation_hook( __FILE__, array( 'WP_Add_Logo_To_Admin', 'activate' ) );
236
- register_deactivation_hook( __FILE__, array( 'WP_Add_Logo_To_Admin', 'deactivate' ) );
237
-
238
- // instantiate the plugin class
239
- $wp_add_logo_to_admin = new WP_Add_Logo_To_Admin();
240
-
241
- /**
242
- * Add settings link to plugin admin page
243
- *
244
- * @since 1.6
245
- */
246
- if ( isset( $wp_add_logo_to_admin ) ) {
247
- function add_logo_plugin_settings_link( $links ) {
248
- $settings_link = '<a href="options-general.php?page=add-logo-to-admin/add-logo-to-admin.php">' . __( 'Settings', 'add-logo' ) . '</a>';
249
- array_unshift( $links, $settings_link );
250
- return $links;
251
- }
252
-
253
- $plugin = plugin_basename( __FILE__ );
254
- add_filter( "plugin_action_links_$plugin", 'add_logo_plugin_settings_link' );
255
- }
256
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
add-logo.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Add Logo to Admin
4
+ Plugin URI: http://bavotasan.com/downloads/add-your-logo-to-the-wordpress-admin-and-login-page/
5
+ Description: Adds a custom logo to your wp-admin and login page.
6
+ Author: c.bavota
7
+ Version: 1.5
8
+ Author URI: http://bavotasan.com
9
+ */
10
+
11
+ //Initialization
12
+ add_action('admin_menu', 'add_logo_init');
13
+
14
+ $add_logo_upload_dir = wp_upload_dir();
15
+ $add_logo_directory = $add_logo_upload_dir['basedir']. '/logos';
16
+
17
+ //add page to admin
18
+ function add_logo_init() {
19
+ global $add_logo_directory, $add_logo_upload_dir;
20
+ if(!empty($_GET['delete-logo'])) {
21
+ unlink($add_logo_directory ."/". $_GET['delete-logo']);
22
+ if($_GET['delete-logo'] == get_option('add_logo_filename')) {
23
+ update_option('add_logo_filename', "");
24
+ update_option('add_logo_logo', "");
25
+ }
26
+
27
+ $location = str_replace("&delete-logo=". $_GET['delete-logo'], "", $_SERVER['REQUEST_URI']."&deleted=true");
28
+ header("Location: $location");
29
+ die();
30
+ }
31
+
32
+ if(!empty($_POST['add_logo_submit'])) {
33
+ if (!wp_verify_nonce($_POST['add_logo_to_admin_nonce'], 'add_logo_to_admin_nonce'))
34
+ exit();
35
+
36
+ if ($_FILES["file"]["type"]){
37
+ $image = str_replace(" ", "-", $_FILES["file"]["name"]);
38
+ move_uploaded_file($_FILES["file"]["tmp_name"],
39
+ $add_logo_directory .'/'. $image);
40
+ update_option('add_logo_logo', $add_logo_upload_dir['baseurl'] . "/logos/" . $image);
41
+ update_option('add_logo_filename', $image);
42
+ }
43
+
44
+ if($_POST['add_logo_on_login']) update_option('add_logo_on_login',$_POST['add_logo_on_login']);
45
+ if($_POST['add_logo_on_admin']) update_option('add_logo_on_admin',$_POST['add_logo_on_admin']);
46
+
47
+ if($_POST['add_logo_filename']) {
48
+ update_option('add_logo_filename',$_POST['add_logo_filename']);
49
+ update_option('add_logo_logo', $add_logo_upload_dir['baseurl'] . "/logos/" . $_POST['add_logo_filename']);
50
+ }
51
+
52
+ if($_POST['saved']==true) {
53
+ $location = $_SERVER['REQUEST_URI'];
54
+ } else {
55
+ $location = str_replace("&deleted=true", "", $_SERVER['REQUEST_URI']."&saved=true");
56
+ }
57
+ header("Location: $location");
58
+ die();
59
+
60
+ }
61
+ $add_logo_page = add_options_page('Add Logo to Admin', 'Add Logo to Admin', "manage_options", __FILE__, 'add_logo_options');
62
+
63
+ //add logo to admin if "yes" is selected
64
+ if(get_option('add_logo_on_admin') == "yes") {
65
+ add_action( "admin_head", 'add_logo_css' );
66
+ add_action( "admin_footer", 'add_logo_script' );
67
+ }
68
+ }
69
+
70
+ //add logo to admin if "yes" selected
71
+ function add_logo_css() {
72
+ $img = get_option('add_logo_logo');
73
+ if(!empty($img))
74
+ echo '<style type="text/css">
75
+ #admin-logo { margin: 10px 0; padding: 0 0 5px; border-bottom: 1px solid #ddd; width: 100%; }
76
+ </style>'."\n";
77
+ }
78
+
79
+ function add_logo_script() {
80
+ $img = get_option('add_logo_logo');
81
+ if(!empty($img))
82
+ echo '<script type="text/javascript">
83
+ /* <![CDATA[ */
84
+ (function($) {
85
+ $(".wrap").prepend("<div id=\"admin-logo\"><img src=\"'.($img).'\" alt=\"\" /></div>");
86
+ })(jQuery);
87
+ /* ]]> */
88
+ </script>';
89
+ }
90
+
91
+ //add logo to login if "yes" is selected
92
+ if(get_option('add_logo_on_login') == "yes") {
93
+ add_action('login_head', 'login_logo_css');
94
+ function login_logo_css() {
95
+ echo '<style type="text/css">
96
+ .login h1 a { background-image: url('.get_option('add_logo_logo').'); }
97
+ </style>'."\n";
98
+ }
99
+ }
100
+
101
+ function add_logo_settings_link( $links ) {
102
+ $settings_link = '<a href="options-general.php?page=add-logo-to-admin/add-logo.php">Settings</a>';
103
+ array_unshift( $links, $settings_link );
104
+ return $links;
105
+ }
106
+
107
+ $plugin = plugin_basename(__FILE__);
108
+ add_filter("plugin_action_links_$plugin", 'add_logo_settings_link' );
109
+
110
+ //set default options
111
+ function set_add_logo_options() {
112
+ add_option('add_logo_on_login','yes');
113
+ add_option('add_logo_on_admin','yes');
114
+ add_option('add_logo_logo',get_option("siteurl").'/wp-content/plugins/add-logo-to-admin/images/logo.png');
115
+ add_option('add_logo_filename', 'logo.png');
116
+ }
117
+
118
+ //delete options upon plugin deactivation
119
+ function unset_add_logo_options() {
120
+ delete_option('add_logo_on_login');
121
+ delete_option('add_logo_on_admin');
122
+ delete_option('add_logo_logo');
123
+ delete_option('add_logo_filename');
124
+ }
125
+
126
+ register_activation_hook(__FILE__,'set_add_logo_options');
127
+ register_deactivation_hook(__FILE__,'unset_add_logo_options');
128
+
129
+ //creating the admin page
130
+ function add_logo_options() {
131
+ global $add_logo_directory, $add_logo_upload_dir;
132
+ if(!file_exists($add_logo_directory)) mkdir($add_logo_directory, 0755);
133
+
134
+ $default_login = get_option('add_logo_on_login');
135
+ $default_admin = get_option('add_logo_on_admin');
136
+ $the_logo = get_option('add_logo_logo');
137
+ ?>
138
+ <div class="wrap">
139
+ <h2>Add Logo to Admin</h2>
140
+ <?php
141
+ if ( $_REQUEST['saved'] ) { echo '<div id="message" class="updated fade"><p><strong>Add Logo to Admin settings saved.</strong></p></div>'; }
142
+ if ( $_REQUEST['deleted'] ) { echo '<div id="message" class="updated fade"><p><strong>Logo deleted.</strong></p></div>'; }
143
+ ?>
144
+ <!-- Add Logo to Admin box begin-->
145
+ <form method="post" id="myForm" enctype="multipart/form-data">
146
+ <table class="form-table">
147
+ <tr valign="top">
148
+ <th scope="row" style="width: 370px;">
149
+ <label for="add_logo_on_login">Would you like your logo to appear on the login page?</label>
150
+ </th>
151
+ <td>
152
+ <input type="radio" name="add_logo_on_login" value="yes" <?php checked($default_login, "yes"); ?> />&nbsp;Yes&nbsp;&nbsp;
153
+ <input type="radio" name="add_logo_on_login" value="no" <?php checked($default_login, "no"); ?> />&nbsp;No
154
+ </td>
155
+ </tr>
156
+ <tr valign="top">
157
+ <th scope="row" style="width: 370px;">
158
+ <label for="add_logo_on_admin">Would you like your logo to appear on the admin pages?</label>
159
+ </th>
160
+ <td>
161
+ <input type="radio" name="add_logo_on_admin" value="yes" <?php checked($default_admin, "yes"); ?> />&nbsp;Yes&nbsp;&nbsp;
162
+ <input type="radio" name="add_logo_on_admin" value="no" <?php checked($default_admin, "no"); ?> />&nbsp;No
163
+ </td>
164
+ </tr>
165
+ <tr valign="top">
166
+ <th scope="row" style="width: 370px;">
167
+ <label for="add_logo_logo">Choose a file to upload: </label>
168
+ </th>
169
+ <td>
170
+ <input type="file" name="file" id="file" />&nbsp;<em><small>Click Save Changes below to upload your logo.</small></em><br />
171
+ (max. logo size 326px by 67px)
172
+ <?php
173
+ $directory = $add_logo_upload_dir['baseurl'] . "/logos/";
174
+ //update_option('add_logo_logo', $directory.get_option('add_logo_filename'));
175
+ // Open the folder
176
+ $dir_handle = @opendir($add_logo_directory) or die("Unable to open $add_logo_directory");
177
+ // Loop through the files
178
+ $count = 1;
179
+ while ($file = readdir($dir_handle)) {
180
+
181
+ if($file == "." || $file == ".." || $file == "index.php" ) {
182
+ continue;
183
+ }
184
+ if($count==1) { echo "<br /><br />Select which logo you would like to use.<br />"; $count++; }
185
+ if($file == get_option('add_logo_filename')) { $checked = "checked"; } else { $checked = ""; }
186
+ echo "<br /><table><tr><td style=\"padding-right: 5px;\"><img src=\"$directory$file\" style=\"max-height:100px;border:1px solid #aaa;padding:10px;\" /></td><td><input id=\"add_logo_filename\" name=\"add_logo_filename\" type=\"radio\" value=\"$file\" $checked />&nbsp;Select<br /><br /><a href=\"options-general.php?page=add-logo-to-admin/add-logo.php&delete-logo=$file\">&laquo; Delete</a></td></tr></table>";
187
+ }
188
+
189
+ // Close
190
+ closedir($dir_handle);
191
+ ?> </td>
192
+ </tr>
193
+ </table>
194
+ <p class="submit">
195
+ <input type="submit" name="add_logo_submit" class="button-primary" value="Save Changes" />
196
+ </p>
197
+ <?php if(function_exists('wp_nonce_field')) wp_nonce_field('add_logo_to_admin_nonce', 'add_logo_to_admin_nonce'); ?>
198
+ </form>
199
+ <!-- Add Logo to Admin admin box end-->
200
+ </div>
201
+ <?php
202
+ }
css/add-logo.css DELETED
@@ -1,6 +0,0 @@
1
- #admin-logo {
2
- margin: 10px 0;
3
- padding: 0 0 5px;
4
- border-bottom: 1px solid #ddd;
5
- width: 100%;
6
- }
 
 
 
 
 
 
index.html ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+ <title>Add Logo to Admin WordPress plugin | Version 1.5</title>
6
+ <style type="text/css">
7
+ code {
8
+ background: #ddd;
9
+ }
10
+
11
+ h1 {
12
+ margin-bottom: 0;
13
+ }
14
+
15
+ </style>
16
+ </head>
17
+
18
+ <body>
19
+ <h1>Add Logo to Admin</h1>
20
+ Version 1.5<br />
21
+ WordPress plugin<br />
22
+ <br />
23
+ <strong>== Installation ==</strong><br />
24
+ <br />
25
+ 1. Unzip the add-logo-to-admin.zip file.<br />
26
+ 2. Upload the <code>add-logo-to-admin</code> folder to the <code>/wp-content/plugins/</code> directory.<br />
27
+ 3. Activate the plugin through the 'Plugins' menu in WordPress.<br />
28
+ 4. Go to Settings => Add Logo to Admin and set your options and add your logo.<br />
29
+ <br />
30
+ <strong>== Frequently Asked Questions ==</strong> <br />
31
+ <br />
32
+ 1) How do I add my own logo?
33
+ <br />
34
+ Just go to Settings => Add Logo to Admin and upload the logo you would like to use.
35
+ <br /><br />
36
+ 2) How big does my logo need to be?
37
+ <br />
38
+ Your logo should not exceed 326px by 67px or it will not fit perfectly on the login screen.
39
+ <br />
40
+ <br />
41
+ <strong>== Change Log ==</strong><br />
42
+ <br />
43
+ 1.5 (2012-01-12)
44
+ <ul>
45
+ <li>Updated for WP 3.3</li>
46
+ <li>Improved coding</li>
47
+ <li>Added security nonce</li>
48
+ </ul>
49
+
50
+ 1.4 (2011-02-18)
51
+ <ul>
52
+ <li>Updated for WP 3.1</li>
53
+ <li>Removed extraneous CSS and JS files</li>
54
+ <li>Improved coding</li>
55
+ </ul>
56
+
57
+ 1.3.3 (2009-03-10)
58
+ <ul>
59
+ <li>Fixed issue with IE7 and logo not displaying</li>
60
+ </ul>
61
+
62
+ 1.3.2 (2009-03-01)
63
+ <ul>
64
+ <li>Fixed issue with invading other admin pages save function</li>
65
+ </ul>
66
+
67
+ 1.3.1 (2009-02-26)
68
+ <ul>
69
+ <li>Fixed issue with spaces in filename</li>
70
+ </ul>
71
+
72
+ 1.3 (2009-02-25)
73
+ <ul>
74
+ <li>Created uploader for logos</li>
75
+ <li>Added "Settings" link on plugins page</li>
76
+ <li>Added option to delete logo</li>
77
+ <li>Added logo select option</li>
78
+ <li>Updated CSS</li>
79
+ </ul>
80
+
81
+ 1.2 (2009-02-23)
82
+ <ul>
83
+ <li>Fixed issue with WP installs in subdirectories</li>
84
+ <li>Removed old code</li>
85
+ <li>Tested on WP version 2.7.1</li>
86
+ </ul>
87
+
88
+ 1.1 (2008-12-24)
89
+ <ul>
90
+ <li>Added admin page with options</li>
91
+ <li>Fixed window.onload JavaScript issue</li>
92
+ <li>Fixed issue with blogs not located in the root directory</li>
93
+ <li>Removed extraneous code</li>
94
+ </ul>
95
+
96
+ 1.0.2 (2008-12-16)
97
+ <ul>
98
+ <li>Fixed weirdness with extra folder</li>
99
+ </ul>
100
+
101
+ 1.0.1 (2008-12-16)
102
+ <ul>
103
+ <li>
104
+ Fixed the code to direct to the proper plugin folder</li>
105
+ </ul>
106
+
107
+ 1.0 (2008-12-15)
108
+ <ul>
109
+ <li>
110
+ Initial Public Release</li>
111
+ </ul>
112
+
113
+ <br />
114
+ <small>Add Logo to Admin plugin created by <a href="http://bavotasan.com">c.bavota</a>.<br />
115
+ <br />
116
+ Copyright &copy; c.bavota. All Rights Reserved.</small><br /><br />
117
+ </body>
118
+ </html>
js/add-logo-select-image.js DELETED
@@ -1,35 +0,0 @@
1
- ( function($) {
2
- var file_frame;
3
- $( '#add-logo-table' )
4
- .on( 'click', '.select-image', function(e) {
5
- e.preventDefault();
6
-
7
- // Let's start over to make sure everything works
8
- if ( file_frame )
9
- file_frame.remove();
10
-
11
- file_frame = wp.media.frames.file_frame = wp.media( {
12
- title: $(this).data( 'uploader_title' ),
13
- button: {
14
- text: $(this).data( 'uploader_button_text' )
15
- },
16
- multiple: false
17
- } );
18
-
19
- file_frame.on( 'select', function() {
20
- var attachment = file_frame.state().get( 'selection' ).first().toJSON();
21
- $( '#add-logo-image' ).val( attachment.url );
22
- $( '#add-logo-image-container' ).html( '<img src="' + attachment.url + '" alt="" style="max-width:100%;" />' );
23
- } );
24
-
25
- file_frame.open();
26
- $( '.delete-image' ).show();
27
- } )
28
- .on( 'click', '.delete-image', function(e) {
29
- e.preventDefault();
30
- $(this).hide();
31
- $( '#add-logo-image' ).val( '' );
32
- $( '#add-logo-image-container' ).html( '' );
33
- } );
34
-
35
- } )(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/add-logo.js DELETED
@@ -1,3 +0,0 @@
1
- ( function($) {
2
- $( '.wrap' ).prepend( '<div id="admin-logo"><img src="' + add_logo_image + '" alt="" /></div>' );
3
- } )( jQuery );
 
 
 
languages/add-logo.pot DELETED
@@ -1,50 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Content-Type: text/plain; charset=utf-8\n"
4
- "Content-Transfer-Encoding: 8bit\n"
5
-
6
- #. Text in function
7
- #: add-logo-to-admin/add-logo-to-admin.php:1
8
- #: add-logo-to-admin/add-logo-to-admin.php:137
9
- msgid "Add Logo to Admin"
10
- msgstr ""
11
-
12
- #. Text in echo
13
- #: add-logo-to-admin/add-logo-to-admin.php:162
14
- msgid "Delete image"
15
- msgstr ""
16
-
17
- #. Text in echo
18
- #: add-logo-to-admin/add-logo-to-admin.php:153
19
- msgid "Display logo on all admin pages"
20
- msgstr ""
21
-
22
- #. Text in echo
23
- #: add-logo-to-admin/add-logo-to-admin.php:149
24
- msgid "Display logo on the login page"
25
- msgstr ""
26
-
27
- #. Text in echo
28
- #: add-logo-to-admin/add-logo-to-admin.php:144
29
- msgid "Logo Options"
30
- msgstr ""
31
-
32
- #. Text in echo
33
- #: add-logo-to-admin/add-logo-to-admin.php:162
34
- msgid "Select image"
35
- msgstr ""
36
-
37
- #. Text in echo
38
- #: add-logo-to-admin/add-logo-to-admin.php:158
39
- msgid "Upload Logo"
40
- msgstr ""
41
-
42
- #. Text in function
43
- #: add-logo-to-admin/add-logo-to-admin.php:117
44
- msgid "You do not have sufficient permissions to access this page."
45
- msgstr ""
46
-
47
- #. Text in echo
48
- #: add-logo-to-admin/add-logo-to-admin.php:164
49
- msgid "Your logo should be no larger than 320px by 80px or else it will be resized on the login screen."
50
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,20 +1,15 @@
1
  === Add Logo to Admin ===
2
- Contributors: tinkerpriest
3
- Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4W58JWNBHWKK4
4
  Tags: custom logo, admin, login, wp-admin, admin logo
5
- Text Domain: add-logo
6
- Domain Path: /languages
7
- Requires at least: 3.5
8
- Tested up to: 3.8
9
- Stable tag: 1.6
10
- License: GPLv2 or later
11
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
  Add a custom logo to your wp-admin and login page.
14
 
15
  == Description ==
16
 
17
- This plugin allows you to customize your admin by adding your own logo to the header. It also replaces the WordPress logo on the login screen with the same custom logo. Tested in Firefox, Safari, Chrome and IE.
18
 
19
  == Installation ==
20
 
@@ -23,79 +18,75 @@ This plugin allows you to customize your admin by adding your own logo to the he
23
  3. Activate the plugin through the 'Plugins' menu in WordPress.
24
  4. Go to Settings => Add Logo to Admin and set your options and add your logo.
25
 
26
- == Frequently Asked Questions ==
27
 
28
  1) How do I add my own logo?
29
 
30
- Just go to Settings => Add Logo to Admin and click on "Select image" to upload your logo.
31
 
32
  2) How big does my logo need to be?
33
 
34
- Your logo shouldn't exceed 320px by 80px or it will be resized on the login screen.
35
 
36
  == Screenshots ==
37
 
38
- 1. The Add Logo to Admin page
39
- 2. How your logo will appear on the login screen
40
 
41
  == Change Log ==
42
 
43
- = 1.6 (2014-02-12) =
44
-
45
- * Added WP media uploader
46
- * Rebuilt plugin using OOP
47
- * Created language file
48
- * Updated screenshots to reflect new admin page
49
- * Added validation to settings
50
-
51
- 1.5.1 (2012-10-04)
52
-
53
- * Fixed login screen image size
54
-
55
  1.5 (2012-01-12)
56
-
57
- * Updated for WP 3.3
58
- * Improved coding
59
- * Added security nonce
 
60
 
61
  1.4 (2011-02-18)
62
-
63
- * Updated for WP 3.1
64
- * Removed extraneous CSS and JS files
65
- * Improved coding
 
66
 
67
  1.3.3 (2009-03-10)
68
-
69
- * Fixed issue with IE7 and logo not displaying
 
70
 
71
  1.3.2 (2009-03-01)
72
-
73
- * Fixed issue with invading other admin pages save function
 
74
 
75
  1.3.1 (2009-02-26)
76
-
77
- * Fixed issue with spaces in filename
 
78
 
79
  1.3 (2009-02-25)
80
-
81
- * Created uploader for logos
82
- * Added "Settings" link on plugins page
83
- * Added option to delete logo
84
- * Added logo select option
85
- * Updated CSS
 
86
 
87
  1.2 (2009-02-23)
88
-
89
- * Fixed issue with WP installs in subdirectories
90
- * Removed old code
91
- * Tested on WP version 2.7.1
 
92
 
93
  1.1 (2008-12-24)
94
-
95
- * Added admin page with options
96
- * Fixed window.onload JavaScript issue
97
- * Fixed issue with blogs not located in the root directory
98
- * Removed extraneous code
 
99
 
100
  1.0.2 (2008-12-16)
101
  Fixed weirdness with extra folder
@@ -105,8 +96,3 @@ Fixed the code to direct to the proper plugin folder
105
 
106
  1.0 (2008-12-15)
107
  Initial Public Release
108
-
109
- == Upgrade Notice ==
110
-
111
- = 1.6 =
112
- Now you can easily select your logo using the WordPress media uploader. Plus the login screen logo will redirect back to your site and use your site name for the link's title tag.
1
  === Add Logo to Admin ===
2
+ Contributors: c.bavota
3
+ Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=1929921
4
  Tags: custom logo, admin, login, wp-admin, admin logo
5
+ Tested up to: 3.3
6
+ Stable tag: 1.5
 
 
 
 
 
7
 
8
  Add a custom logo to your wp-admin and login page.
9
 
10
  == Description ==
11
 
12
+ This plugin allows a user to customize their Admin panel by adding their own logo to the header. It also replaces the WordPress logo on the login screen with the same custom logo. Tested in Firefox, Safari, Chrome and IE.
13
 
14
  == Installation ==
15
 
18
  3. Activate the plugin through the 'Plugins' menu in WordPress.
19
  4. Go to Settings => Add Logo to Admin and set your options and add your logo.
20
 
21
+ == Frequently Asked Questions ==
22
 
23
  1) How do I add my own logo?
24
 
25
+ Just go to Settings => Add Logo to Admin and upload the logo you would like to use.
26
 
27
  2) How big does my logo need to be?
28
 
29
+ Your logo should not exceed 326px by 67px or it will not fit perfectly on the login screen.
30
 
31
  == Screenshots ==
32
 
33
+ 1. Add logo to Admin
34
+ 2. Add logo to Login
35
 
36
  == Change Log ==
37
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  1.5 (2012-01-12)
39
+ <ul>
40
+ <li>Updated for WP 3.3</li>
41
+ <li>Improved coding</li>
42
+ <li>Added security nonce</li>
43
+ </ul>
44
 
45
  1.4 (2011-02-18)
46
+ <ul>
47
+ <li>Updated for WP 3.1</li>
48
+ <li>Removed extraneous CSS and JS files</li>
49
+ <li>Improved coding</li>
50
+ </ul>
51
 
52
  1.3.3 (2009-03-10)
53
+ <ul>
54
+ <li>Fixed issue with IE7 and logo not displaying</li>
55
+ </ul>
56
 
57
  1.3.2 (2009-03-01)
58
+ <ul>
59
+ <li>Fixed issue with invading other admin pages save function</li>
60
+ </ul>
61
 
62
  1.3.1 (2009-02-26)
63
+ <ul>
64
+ <li>Fixed issue with spaces in filename</li>
65
+ </ul>
66
 
67
  1.3 (2009-02-25)
68
+ <ul>
69
+ <li>Created uploader for logos</li>
70
+ <li>Added "Settings" link on plugins page</li>
71
+ <li>Added option to delete logo</li>
72
+ <li>Added logo select option</li>
73
+ <li>Updated CSS</li>
74
+ </ul>
75
 
76
  1.2 (2009-02-23)
77
+ <ul>
78
+ <li>Fixed issue with WP installs in subdirectories</li>
79
+ <li>Removed old code</li>
80
+ <li>Tested on WP version 2.7.1</li>
81
+ </ul>
82
 
83
  1.1 (2008-12-24)
84
+ <ul>
85
+ <li>Added admin page with options</li>
86
+ <li>Fixed window.onload JavaScript issue</li>
87
+ <li>Fixed issue with blogs not located in the root directory</li>
88
+ <li>Removed extraneous code</li>
89
+ </ul>
90
 
91
  1.0.2 (2008-12-16)
92
  Fixed weirdness with extra folder
96
 
97
  1.0 (2008-12-15)
98
  Initial Public Release
 
 
 
 
 
screenshot-1.jpg CHANGED
Binary file
screenshot-2.jpg CHANGED
Binary file