• Resolved s1r0n

    (@s1r0n)


    I am trying to run the following code. I basically want to output an option menu at the bottom of certain threads. I don’t want to tag individual posts or forums, but threads. Is there any way to do this?

    
    add_filter('asgarosforum_filter_post_content', 'lp_test_output',10,2); 
     function lp_test_output($post_content,$post_id) {
    //echo $post_id;
         if ($thread_id== 15) {
             $extras = "<a href=\"https://www.lightningpath.org/forums/?view=addtopic&id=10\">Discuss</a>";
         }
         
         
         return $post_content . $extras;     
     } 
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Asgaros

    (@asgaros)

    Hello @s1r0n

    You can use the asgarosforum_thread_custom_content_bottom-Hook. The ID of the current topic can be accessed with the following code:

    add_action('asgarosforum_thread_custom_content_bottom', 'lp_test_output'); 
    function lp_test_output() {
        global $asgarosforum;
        $current_topic_id = $asgarosforum->current_topic;
    
        if ($current_topic_id == 15) {
            echo "<a href=\"https://www.lightningpath.org/forums/?view=addtopic&id=10\">Discuss</a>";
        }    
     } 
    Thread Starter s1r0n

    (@s1r0n)

    Brilliant. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘thread id’ is closed to new replies.