Skip to:
Content

BuddyPress.org

Changeset 684


Ignore:
Timestamp:
12/14/2008 08:07:17 PM (17 years ago)
Author:
apeatling
Message:

Fixing log out link in admin-bar thanks to burtadsit for patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-adminbar.php

    r648 r684  
    7575   
    7676        $alt = ( $counter % 2 == 0 ) ? ' class="alt"' : '';
    77    
    78         echo '<li' . $alt . '><a id="logout" href="' . site_url() . '/wp-login.php?action=logout">' . __('Log Out', 'buddypress') . '</a></li>';
    79         echo '</ul>';
     77
     78        if ( function_exists('wp_logout_url') ) {
     79            echo '<li' . $alt . '><a id="logout" href="' . wp_logout_url(site_url()) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';                   
     80        } else { 
     81            echo '<li' . $alt . '><a id="logout" href="' . site_url() . '/wp-login.php?action=logout&amp;redirect_to=' . site_url() . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
     82        }
     83             
     84        echo '</ul>';
    8085        echo '</li>';
    8186    }
     
    8489// return a string indicating user's role in that blog
    8590function get_blog_role_for_user( $user, $blog ) {
     91   
     92    // If the user is a site admin, just display admin.
     93    if ( is_site_admin() )
     94        return __( 'Admin', 'buddypress');
     95   
    8696    $roles = get_usermeta( $user, 'wp_' . $blog . '_capabilities' );
    8797
Note: See TracChangeset for help on using the changeset viewer.