Notifications
Clear all

wpForo 1.x.x [Closed] How to close a topic by API?

1 Posts
1 Users
0 Reactions
632 Views
Posts: 35
Topic starter
(@tahtu)
Member
Joined: 5 years ago

I would like to close a topic from PHP.

For this, I tried this:

 WPF()->topic->edit( [ 'topicid' => 1, 'closed' => 1] )

... but this does not close it.

I can't find a solution, but I think this should be called also:

wpforo_clean_cache( 'topic', 1 )

Do I have to call a SQL UPDATE statement directly, or do you have a function for me, doing this?