WordPress.org

Ready to get started?Download WordPress

Ideas

Comment User ID template tag

  1. xCAT
    Member

    12345

    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: 6 years ago #
  2. Although I haven't played around with it much, I think this should get the ID:

    $comment->user_id

    So, you could do something like this:

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

    http://codex.wordpress.org/Function_Reference/get_userdata

    Posted: 6 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    2 Votes
  • Status

    This idea has been implemented