Skip to content

Instantly share code, notes, and snippets.

@westi
Created January 7, 2011 13:29
Show Gist options
  • Save westi/769449 to your computer and use it in GitHub Desktop.
Save westi/769449 to your computer and use it in GitHub Desktop.
I like the admin bar that we are adding in the soon to be released WordPress 3.1 so much that I wanted it to always show on my site. This way you get an easy to use search box on every page even when logged out. I wrote a quick plugin file which I dro
<?php
function pjw_login_adminbar( $wp_admin_bar) {
if ( !is_user_logged_in() )
$wp_admin_bar->add_menu( array( 'title' => __( 'Log In' ), 'href' => wp_login_url() ) );
}
add_action( 'admin_bar_menu', 'pjw_login_adminbar' );
add_filter( 'show_admin_bar', '__return_true' , 1000 );
@westi
Copy link
Author

westi commented Jan 7, 2011

I like this alot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment