WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/06/2011 11:06:24 PM (11 years ago)
Author:
koopersmith
Message:

Add user actions dropdown to admin header. see #17324.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r17800 r17827  
    142142</h1>
    143143
    144 <?php do_action('in_admin_header'); ?>
     144<?php
     145
     146do_action('in_admin_header');
     147
     148// Generate user profile and info links.
     149$howdy = sprintf( __('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity );
     150$links = array();
     151
     152if ( is_multisite() && is_super_admin() ) {
     153    if ( !is_network_admin() )
     154        $links[10] = '<a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>';
     155    else
     156        $links[10] = '<a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
     157}
     158$links[15] = '<a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>';
     159
     160$links = apply_filters( 'admin_user_info_links', $links, $current_user );
     161ksort( $links );
     162
     163// Trim whitespace and pipes from links, then convert to list items.
     164$links = array_map( 'trim', $links, array_fill( 0, count( $links ), " |\n\t" ) );
     165$links = '<li>' . implode( '</li><li>', $links ) . '</li>';
     166
     167?>
    145168
    146169<div id="wphead-info">
    147170<div id="user_info">
    148 <p><?php
    149 $links = array();
    150 $links[5] = sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity);
    151 if ( is_multisite() && is_super_admin() ) {
    152     if ( !is_network_admin() )
    153         $links[10] = '| <a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>';
    154     else
    155         $links[10] = '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
    156 }
    157 $links[15] = '| <a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>';
    158 
    159 $links = apply_filters('admin_user_info_links', $links, $current_user);
    160 ksort($links);
    161 
    162 echo implode(' ', $links);
    163 ?></p>
    164 </div>
    165 </div>
     171<p><?php echo $howdy; ?></p>
     172<div id="user_info_arrow">
     173    <div id="user_info_links_wrap"><div id="user_info_links">
     174        <ul><?php echo $links; ?></ul>
     175    </div></div>
     176</div>
     177</div>
     178</div>
     179
    166180</div>
    167181
Note: See TracChangeset for help on using the changeset viewer.