bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

How to get poster name

(3 posts)
  • Started 3 months ago by jldean
  • Latest reply from jldean
  • This topic is resolved

Tags:

  1. jldean
    Member

    Hi

    I'm just trying to fix a plugin (Moderation Hold) so that it updates the 'Last Poster' field correctly when a post is approved.

    It currently uses this to set the poster id and name:
    $uid = $bb_post->poster_id;
    $uname = $bb_post->poster_name;

    But the user name doesn't get returned. Is there a correct function for this?

    Thanks!

    Posted 3 months ago #
  2. Try: get_topic_author() or something. There was a wiki where you could find the correct "tag" @ bbpulp.org but that one seems to be down at the moment...

    Posted 3 months ago #
  3. jldean
    Member

    Ah yes - I had a bit of a fiddle and found bb_get_user

    $uid = $bb_post->poster_id;
    $bb_user = bb_get_user( $uid );
    $uname = $bb_user->user_nicename;

    This does the job fine :) Thanks

    Posted 3 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.