WordPress.org

Ready to get started?Download WordPress

Forums

Can I add an extra link to the Meta section? (7 posts)

  1. raygene
    Member
    Posted 6 years ago #

    Hi,

    I love WP but it irritates the heck out of me that when a user (subscriber role) logs in, he gets taken to the dashboard (which is useless for subscribers) and the only option he can click on is "Profile".

    I solved part of this problem (thanks to Whooami) by modifying a bit of code that redirects users to the main page after logging in by changing a bit of code in wp-login.php:

    case 'login' :
    default:
    	if ( isset( $_REQUEST['redirect_to'] ) )
    		$redirect_to = $_REQUEST['redirect_to'];
    	else
    		$redirect_to = '/blogname'; (instead of 'wp-admin/')

    Now, what I would like to do is add a "Profile" link to the Meta sidebar that would take the user directly to his profile without going through the dashboard, for example (when logged-in):

    Settings (changed from Site Admin)
    Log Out
    Profile
    Entries RSS
    Comments RSS
    WordPress.org

    Thanks,
    Gene

  2. whooami
    Member
    Posted 6 years ago #

    you do that by using a checking if theyre logged in, and using a conditional. I could give you my code but its definitely outdated and pro'ly wont work for you.

    search for "is logged in" (w/o the quotes).. there is probably something within those threads.

  3. raygene
    Member
    Posted 6 years ago #

    Thanks Whoo,

    Would you mind sharing your "outdated" code, being that I'm still learning, might help me a bit. BTW, would I be making the changes in my widgets.php file? That's where I changed Site Admin to Settings.

    Cheers,
    Gene

  4. whooami
    Member
    Posted 6 years ago #

  5. raygene
    Member
    Posted 6 years ago #

    Thanks, good stuff. Would I be looking for this in the widgets.php so it would apply to all themes (like I did with the Site Admin -> Settings change)?

    Cheers,
    Gene

  6. raygene
    Member
    Posted 6 years ago #

    Sorry, it was in general-template.php

    Duhh...

  7. raygene
    Member
    Posted 6 years ago #

    OK, fixed by changing one line in general-template.php, will post a hack for this.

    Thanks again,
    Gene

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.