Notifications
Clear all

wpForo 1.x.x [Closed] Add a tracking code to the "Add topic" button

6 Posts
2 Users
0 Reactions
3,565 Views
Posts: 8
Topic starter
(@lesly)
Active Member
Joined: 6 years ago

Hey guys, so I try to add a tracking code into the post topic button to know when a user actually post something trough Active Campaign. Into wpforo/wpf-themes/classic/index.php I found the add topic button that is at the top right of the forums pages, but I'm looking for the one that is at the very end of the topic box editor that open when you click it. Cannot find it.

5 Replies
Posts: 8
Topic starter
(@lesly)
Active Member
Joined: 6 years ago

So I look into all the .php in the /classic/ and cannot find where is the "add topic" button so I can add my tracking code on it ><.

Is it any way that can be achieved?

Sofy
Posts: 5068
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @lesly,

You need to use the function topic_form($forumid) function in wp-content/plugins/wpforo/wpf-includes/class-template.php  file.  

However, we don't recommend to change the function, all changes will be lost during the upgrade process.

You can use the hooks for this purpose: 

e.g.

add_action('wpforo_editor_topic_submit_after', 'YOUR_CUSTOM_FUNCTION_NAME');
Posts: 8
Topic starter
(@lesly)
Active Member
Joined: 6 years ago

Hey Sofy, sweet, thanks for the answer. I guess I cannot just put /wpf-includes/class-template.php in my child theme and make the change directly in the code without using the hook?

Sofy
Posts: 5068
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @lesly,

Yes, you're right, you cannot put the /wpf-includes/class-template.php file in your child theme. You need to use hooks for this purpose. 

Page 1 / 2