Hook help
Yworld@yworld
397 Posts
#1 · April 22, 2017, 10:13 pm
Quote from Yworld on April 22, 2017, 10:13 pmHi 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
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
Click for thumbs down.0Click for thumbs up.0
Last edited on April 22, 2017, 10:13 pm
#2 · April 22, 2017, 11:04 pm
Quote from Asgaros on April 22, 2017, 11:04 pmYeah, its right. Maybe it makes sense to give the IDs to the hooks as well:
https://github.com/Asgaros/asgaros-forum/commit/76aada94f1b2b48a4c5cdf69365f6d1a8a57070c
Yeah, its right. Maybe it makes sense to give the IDs to the hooks as well:
https://github.com/Asgaros/asgaros-forum/commit/76aada94f1b2b48a4c5cdf69365f6d1a8a57070c
Click for thumbs down.0Click for thumbs up.0
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!
#3 · April 22, 2017, 11:30 pm
Quote from Yworld on April 22, 2017, 11:30 pmThanks, 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>'; } }🙂
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>'; } }
🙂
Click for thumbs down.0Click for thumbs up.0
Last edited on April 22, 2017, 11:31 pm
#4 · April 22, 2017, 11:35 pm
Quote from Yworld on April 22, 2017, 11:35 pmCan 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); ?>
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); ?>
Click for thumbs down.0Click for thumbs up.0
Last edited on April 22, 2017, 11:36 pm
#5 · April 23, 2017, 8:27 am
Quote from Yworld on April 23, 2017, 8:27 amOtherwise, the avatar does not work and other information.
echo '<div class="forum-stats">'.get_avatar($lastpost_data->author_id, 40).'</div>';
Otherwise, the avatar does not work and other information.
echo '<div class="forum-stats">'.get_avatar($lastpost_data->author_id, 40).'</div>';
Click for thumbs down.0Click for thumbs up.0
Last edited on April 23, 2017, 8:34 am