WordPress.org

Ready to get started?Download WordPress

Forums

Logging out with one click advanced (1 post)

  1. soblonde
    Member
    Posted 2 years ago #

    This is for version 3.2. Following on from olyma's hack, I now have devised the code further, including a link to profile, and placing dashes between each link.

    Add to functions.php

    // One Click Logout
    function newlogout() {
    ?>
    Howdy (change for greeting of choice)
    <div style="float:right;z-index:100;position:absolute;right:0px;top:0px;background:white;padding:8px 30px 5px 100px;border:0px;">
    Ciao,
    <?php
        wp_get_current_user();
    	$current_user = wp_get_current_user();
    	if ( !($current_user instanceof WP_User) )
    	return;
        echo ' ' . $current_user->user_login . ' ';
     ?>
     | <a href="profile.php">Your profile</a> |
    <a href="<?php echo wp_logout_url() ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a>
    
    </div>
    
    <?php
    }
    add_action( 'in_admin_header', 'newlogout' );

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.