WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multi-Site: How can I create a link to the wordpress users admin DASHBOARD. (10 posts)

  1. ladypop2012
    Member
    Posted 1 year ago #

    As you know wordpress MU has the admin bar TAB called "MY SITES" if you drop down on this tab you will see " THE MAIN BLOG SITE NAME: and "THE WORDPRESS USERS SITE NAME"

    I do not want to SHOW " THE MAIN BLOG SITE NAME" in the mysites admin bar drop down menu.

    Choices im asking help on cause there are a few, either one ill be happy camper :)

    #1. How to remove The main blog from the mysites drop down.
    #2. How to create link that takes wordpress user to their admin dashboard

    ISSUE: I dont want users navigating to http://www.MainSite.com/admin
    I feel this area is confusing for the users and I do not want this.

    If I can accomplish either #1 or #2 from above this will be awesome.

  2. David Sader
    Member
    Posted 1 year ago #

    1. remove users from the main site(wp-admin/users.php) so they are only members of their own sites.
    2.

    <?php $url = get_dashboard_url();
    echo $url; ?>
  3. ladypop2012
    Member
    Posted 1 year ago #

    Thank you so much @David Sader for helping out... okay i want to take route #2. But when I place the php code it does not work cause its telling me

    Warning: Missing argument 1 for get_dashboard_url(),

    Seems like its conflicting with the same code being called casue I also see this in the error

    eval()'d code on line 1 and defined in /home/writemy/public_html/go/wp-includes/link-template.php on line 2260

    Have any idea what I need to do, can you tell me how to properly link this Echo so I can make a hyper link Text needs to say "My Dashboard

    Thanks a million

  4. David Sader
    Member
    Posted 1 year ago #

    Oops, you need the userid arg so it knows who's dashboard to get.

    <?php
    if(is_user_logged_in()) {
    $user = get_current_user_id();
    $url = get_dashboard_url($user);
    echo '<a href="'.$url.'">My Dashboard</a>';
    }
    ?>
  5. ladypop2012
    Member
    Posted 1 year ago #

    Thank You the code is working !!! EXCELLENT thank you

  6. airot87
    Member
    Posted 10 months ago #

    would this need to be done for every new user? or does this work for everyone? ive been having the same issue and have been trying to find help to resolve it for over a week...i really hope this is it

  7. gcarlos8377
    Member
    Posted 1 month ago #

    @David Sader

    Hi I just want to know where should I place that code at

    <?php
    if(is_user_logged_in()) {
    $user = get_current_user_id();
    $url = get_dashboard_url($user);
    echo 'My Dashboard';
    }
    ?>

    Regards

  8. David Sader
    Member
    Posted 1 month ago #

    Read the original post:

    #2. How to create link that takes wordpress user to their admin dashboard

    The code I offered as an answer is a "how" not a "where". I have no Idea where the original poster decided where to put the link. Somewhere in the theme files I suppose: footer, header, index, sidebar. I do not know.

  9. gcarlos8377
    Member
    Posted 1 month ago #

    Thanks for your help @David Sader

    @ladypop2012 Can you let me know where I can use this code at
    <?php
    if(is_user_logged_in()) {
    $user = get_current_user_id();
    $url = get_dashboard_url($user);
    echo 'My Dashboard';
    }
    ?>

    I trully appreciate your help thanks in advance

  10. gcarlos8377
    Member
    Posted 1 month ago #

    Hi @David Sader

    I created a new page template and I added the file to my theme folder.

    Now the code gives me a URL and when you click the URL it redirect you to main site dashboard for some reason. Probably is because of the Membership plugin I use. When they sign up the plugin creates a user on main site as a subscriber now I give the users the option to create a new blog on the Network using the wp-signup.php page

    Thanks anyways for your contribution.

    Regards

Topic Closed

This topic has been closed to new replies.

About this Topic