I am trying to display a comment's author's earned badges, which displays with the following shortcode [mycred_my_badges user_id=""]
.
I am adding a small change to a plugin called woodiscuz, here is my code:
$comment_post_author_id = get_comment_author( $comment->comment_ID );
$comment_author = get_user_by('login', '' . $author . '');
$comment_author_id = $comment_author->ID;
$shortcode = '[mycred_my_badges user_id="' . $comment_author_id . '"]';
$output .= '<div class="comment-author-badges">' . do_shortcode($shortcode) . ' ' . print $shortcode . ' ' . '</div></div>';
This code returns [mycred_my_badges user_id=""]
, clearly I am missing something here.
I am new to PHP so any help with this would be great.
Cheers, D