Reply To: add a link to discussion
I found this. With this function im able to insert some content in the first reply.
But this part dont work out, it just shows text and not which user id it is…:
<a href=\create-new-post?vis=$current_user_id\
How can i get a variable, here user_id, to create-new-post page ?
I have tried with “$current_user_id ” and ‘$current_user_id’ …..
function add_content_before_first_reply_content($content,$id){
$post = get_post($id);
$topic_id = bbp_get_topic_id();
$reply_id = bbp_get_reply_id();
$current_user_id = get_current_user_id();
$content_to_add = ‘ Add new blog
‘;
if ($topic_id === $reply_id) {
// do whatever you need to in here
$content .= $content_to_add;
}
return $content;
}
add_filter( ‘bbp_get_reply_content’, ‘add_content_before_first_reply_content’, 99, 2 );