Forum breadcrumbs – You are here:Asgaros Support ForumSupportHook help
Please or Register to create posts and topics.

Hook help

Hi Thomas

It does not work for me:

add_action('asgarosforum_custom_forum_column', 'forum_column_advertisement', 10, 2);
function forum_column_advertisement($??????) {
??????
  $forum_1 = $forum->id;
  if ($forum_1 == 2) {
    echo '<div class="forum-stats">code</div>';
}

}

How to do it right?

Thank you

Yeah, its right. Maybe it makes sense to give the IDs to the hooks as well:

https://github.com/Asgaros/asgaros-forum/commit/76aada94f1b2b48a4c5cdf69365f6d1a8a57070c

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Thanks, everything works now!

add_action('asgarosforum_custom_forum_column', 'forum_column_advertisement', 10, 2);
function forum_column_advertisement($forum_id) {
  if ($forum_id == 1) {
    echo '<div class="forum-stats">code</div>';
 }

}

🙂

Can add?

do_action('asgarosforum_custom_forum_column', $forum->id, $author_id, $lastpost_data);
<?php do_action('asgarosforum_custom_topic_column', $thread->id, $author_id, $lastpost_data); ?>

 

Otherwise, the avatar does not work and other information.

echo '<div class="forum-stats">'.get_avatar($lastpost_data->author_id, 40).'</div>';