• Hi Peter-

    I display my custom table on the back-end of the site. Each row of the custom table is a user who is also a member of the site. I would like to include a link to the user’s WP profile when the table is displayed. I thought this could done with a dynamic hyperlink and I followed the instructions on this blog post https://wpdataaccess.com/2020/03/22/dynamic-hyperlinks. However, I can’t get a View link to display as an extra column. Do I need to add the user’s profile hyperlink as a column in my custom table?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter justmigrating

    (@justmigrating)

    I found how to add the link (didn’t see that I had to edit the Publisher). So, now I have a User link added to my table display, but I get an error of invalid user ID. I have a column in my custom table (user_id) that corresponds to the ID field in the WP users table. This is my link in Explorer:

    User

    When I mouse over the link in the table, the ID=$$user_id$$ rather than the actual ID of the user.

    Thread Starter justmigrating

    (@justmigrating)

    Never mind the above comment. I found that I had to include the user_id field from my custom table in my Publisher to have the User link work, but I don’t want the user_id field displayed, mainly because it doesn’t display important information and now I have two extra fields being displayed in my publisher table: the User link column and the User Id. Is there a way I can turn the User Id column into the user hyperlink? Or is there a way to hide the User Id field from being displayed?

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi justmigrating,

    Welcome back!

    You can only add column values of the table you are adding the dynamic hyperlink to. So, the question is, does your table have a user_id column? In that case you can add that column to your dynamic hyperlink.

    If your table does not have a user_id column (which I pressume), can you join your table with a table which contains a user_id? You could create a view and use your view instead of the table.

    Does this help?

    Best regards,
    Peter

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘link to user’s profile in table display’ is closed to new replies.