The MU forums have moved to WordPress.org

Global Dashboard (9 posts)

  1. drmike
    Member
    Posted 17 years ago #

    Greets:

    Has a request to do a Global Dashboard drop down just like they have over at wp.com. I copied over a portion of the "Display your blogs if you're signed in" that we use on teh home page. Copied below.

    If anyone's bored this weekend, care to take a shot on editing it to display the blog's names instead of the URL?

    Thanks,
    -drmike

    Open up /wp-admin/admin-header.php and add in the following after the

    </span></h1>
    line and before the
    </div>
    :

    <?php
    $blogs = get_blogs_of_user($current_user->ID);
    echo "<form name="jump">n";
    echo "<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">n";
    if ( ! empty($blogs) ) foreach ( $blogs as $blog ) {
    echo "<option value='http://" . $blog->domain . $blog->path . "wp-admin/'>" . $blog->domain . $blog->path . "</option>n";
    	}
    echo "</select>n";
    echo "</form>n";
    ?>
    
  2. drmike
    Member
    Posted 17 years ago #

    Do note that those lone 'n's in there are slash-n's to make a new line within the html. That and the internal quotes need to be slash-quotes. I think everything else is right.

  3. suleiman
    Member
    Posted 17 years ago #

    this would integrate with admin bar plugin?

  4. drmike
    Member
    Posted 17 years ago #

    It wouldn't. Global Dashboard is on the wp-admin side.

    I realized on my walk home that night that even wp.com doesn't display the Blog Title, just the machine name of the blog.

  5. lunabyte
    Member
    Posted 17 years ago #

    I put something "similar" to this in a widget. If the user is logged in, it displays all their blogs by title (title links to blog), and then a dashboard link in paranthesis behind it.

    Going to tack on the same list to the end of the right column of the dashboard someday soon as well.

    Not sure if it will help anything, but it might make it more convenient for a few people.

  6. kingler
    Member
    Posted 17 years ago #

    I use a similar feature in our admin bar. Need some polishing work still.

  7. drmike
    Member
    Posted 17 years ago #

    Agreed. That's why I have in there: "If anyone's bored this weekend, care to take a shot on editing it to display the blog's names instead of the URL?" :)

  8. lunabyte
    Member
    Posted 17 years ago #

    I "wish" I would have been bored this weekend. lol

  9. gumdrop
    Member
    Posted 17 years ago #

    hehehe me too. :-=

About this Topic