Comment User ID template tag

  1. xCAT


    There are many template tags for a comment author (name, url, ip, etc), but I'm missing one tag, the WordPress User ID of the comment author (if registered). WordPress does actually save the User ID already, the only problem is that you can't access it with a template tag.

    Posted: 10 years ago #
  2. Justin Tadlock
    WordPress God

    Although I haven't played around with it much, I think this should get the ID:


    So, you could do something like this:

    $user = get_userdata($comment->user_id);
    echo $user->ID;


    Posted: 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    2 Votes
  • Status

    This idea has been implemented