Quick n’ Dirty Admin Login Screen

Posted: 29th Jan 2008, in: Snippets, plugins - Older Post - Newer Post

Quick N Dirty

This is the sixth of my Quick N Dirty plugin posts and I am doing something different today; I am going to explain a plugin created by someone else.

The plugin I want to focus on today is the bm_custom_login plugin. This plugin allows you to replace your WordPress login screen with something a little more branded, and is a brilliant demonstration of just how easy it can be to produce a plugin.

Just like all the plugins in this series this uses only one hook, and actually has even less code than I have used so far.

The hook is uses is: login_head

add_action(‘login_head’, ‘bm_custom_login’);

This action fires in the HTML head of the login page allowing you to add any CSS, or Javacript files you want to. The plugin outputs only one line of HTML, but the effects are significant. Here is the function it calls:

function bm_custom_login() {
	echo ‘<link rel="stylesheet" type="text/css" href="’ . get_settings(’siteurl’) . ‘/wp-content/plugins/bm-custom-login/bm-custom-login.css" />’;
}

It links to a CSS file in the plugin folder that points the login screen towards the custom images in the plugin folder.

Tarquin Login

I won’t reproduce any more of the plugin here, I encourage you to download a copy from the Binary Moon site and take a look at it. It has everything you need, the plugin, the CSS file and a template image to help you produce your own.

My version is on the left.

Tomorrow I am going to start looking at how plugins link in to the admin pages themselves. I will be demonstrating a plugin to create an admin page and display information on it.

 

Comments

Leave a Reply

I am currently testing a comment link policy which means commenters do not get a link. There is a poll, and open comments for feedback on the comment policy page.

Please note. I am currently using an experimental antispam technique on this blog. If you run into problems please let me know using the Get in Touch link at the top of the page. Thanks, Andy.

Subscribe without commenting

Feed Icon - Get fed with RSS