Make WordPress Core


Ignore:
Timestamp:
09/16/2011 05:01:54 AM (13 years ago)
Author:
koopersmith
Message:

Admin bar UX improvements. First pass, see #18197

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r18680 r18683  
    28502850    echo get_parent_post_rel_link($title);
    28512851}
     2852
     2853/**
     2854 * Add the "Dashboard"/"Visit Site" menu.
     2855 *
     2856 * @since 3.2.0
     2857 * @deprecated 3.3
     2858 */
     2859function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) {
     2860    _deprecated_function( __FUNCTION__, '3.3' );
     2861
     2862    $user_id = get_current_user_id();
     2863
     2864    if ( 0 != $user_id ) {
     2865        if ( is_admin() )
     2866            $wp_admin_bar->add_menu( array( 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url() ) );
     2867        elseif ( is_multisite() )
     2868            $wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );
     2869        else
     2870            $wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );
     2871    }
     2872}
Note: See TracChangeset for help on using the changeset viewer.