WordPress.org

Ready to get started?Download WordPress

Forums

Is there a better way to show UID in comment loop? (3 posts)

  1. tgiokdi
    Member
    Posted 4 years ago #

    Here's what I'm using right now:

    ' (UID#<?php $user = get_userdata($comment->user_id); echo $user->ID; '?>)

    but that code is slowing my site down a bit. is there a smarter way to show the user ids in the comments?

    here's an example of what I'm doing:
    http://www.myconfinedspace.com/2009/08/29/fetching-smile/

  2. Mark / t31os
    Moderator
    Posted 4 years ago #

    Isn't..

    $comment->user_id

    the same value as..

    $user->ID;

    Looks to me like you're calling get_usermeta to get data you already have...

    Pretty sure you'll get the same result from..

    (UID#<?php echo $comment->user_id; ?>)
  3. tgiokdi
    Member
    Posted 4 years ago #

    sweet, that works, thanks a ton!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags