amr users
[Plugin: AmR Users] user links (3 posts)

  1. acub
    Posted 4 years ago #

    I know your plugin is intended primarily to the csv export and by use of admins only. However, I'm using it to generate some custom userlists based on custom usermeta.

    Is there any simple way of setting lists to display user_url instead of edit_user? It would be most helpfull if I had a way of changing this option based on wether the user viewing the list has or does not have editing rights for users, but changing it globally would do the trick too (I have an edit user link in each of the users' pages).

    Thank you.

    Later edit: looking through plugin files I'm guessing it has to do with the use of the amr_format_user_cell function. Please correct me if I'm wrong.


  2. anmari
    Plugin Author

    Posted 4 years ago #

    When you say

    display user_url instead of edit_user?

    I assume you mean the link behind the user_login field?

    In that case you want to change line 355


    if (is_object($u) and isset ($u->ID) ) return('<a href="'.WP_SITEURL.'/wp-admin/user-edit.php?user_id='.$u->ID.'">'.$v.'</a>');

    to something like

    if (is_object($u) and isset ($u->ID) )
        return('<a href="'.$u->user_url.'">'.$v.'</a>');

    I am planning an up date to the plugin to allow more flexibility. Probably allow filters on the fields something like that so people can add their own bits.

    Realistically it will be a couple of weeks at least before I get to it.

  3. acub
    Posted 4 years ago #

    Yes, that's exactly what I needed. Thank you.
    I'll also add a condition before it to only change the links for users that cannot edit other users.

    Thank you very much.

    As for added functionality, well... it's always welcome :)
    I'd put a link="" parameter to the shortcode with possible values of all cases in amr_format_user_cell function, eventually adding another param of editlinks="" with values of 0 or 1 making links immune (or not) to change for users with edit user capabilities.

    And filters would be nice, indeed.

    Thank you for sharing your work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • amr users
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic