WordPress.org

Ready to get started?Download WordPress

Forums

amr users
[resolved] Adding a custom link (3 posts)

  1. Alternatewords
    Member
    Posted 8 months ago #

    I know this has been brought up before and I've also read all the documentation on wpusersplugin.com. However, I am still stuck.

    On my site I am using User Profile Made Easy (http://profileplugin.com/). It uses user_ID to retrieve any users profile, e.g. xxxxx.com/profile/?viewuser=1. I'd like to add this to the column display_name. I know in a previous version I was able to do this via 'Before' and 'After' (I did something like this for a private messaging plugin). But for the life of me I can't remember how I did it.

    I wouldn't mind adding a custom function, but am not sure how. I tried this example, reasoning I could adapt it to my needs:

    if (!function_exists('ausers_format_user_nicename')) {
     function ausers_format_user_nicename($v, $u) {
     if (!empty($u->user_url))
     return ('user_url.'">'.$v.'');
     else return ($v);
     }
     }

    But I am greeted with a white screen in amr. Any assistance would be greatly appreciated.

    http://wordpress.org/plugins/amr-users/

  2. anmari
    Member
    Plugin Author

    Posted 8 months ago #

    white space usually means you have something wrong in your php code.

    also the html you are returning there is badly broken.

    try

    return ('<href="'.$u->user_url.'">'.$v.'</a>');

    then when you have that working, replace the user url with whatever you need to generate the profile link that that plugin generates.

  3. Alternatewords
    Member
    Posted 8 months ago #

    Sorry, still couldn't get this to work. I resorted to directly editing an existing function (edit_user) to accomplish what I need. I know it's not recommended and I have to change after each plugin update but I'll have to make due, I am not a PHP programmer and no time time to dig into this.

    Thanks anyway.

Reply

You must log in to post.

About this Plugin

About this Topic