Notifications
Clear all

Script [Solved] Hook for Post Status Change (Approval) in wpForo

3 Posts
2 Users
1 Reactions
160 Views
st7878
Posts: 115
Topic starter
(@aima-forum)
Estimable Member
Joined: 5 years ago

Hello wpForo Support Team,

I’m developing a plugin that integrates wpForo with Telegram to send notifications when a post is approved (i.e., when its status changes from "Not Approved" (status = 1) to "Approved" (status = 0)). I’m currently using the wpforo_after_add_post hook to detect new posts, but this hook does not fire when a post’s status is updated (e.g., during moderation approval).

Could you please tell me which hook or event is triggered when a post’s status changes, specifically when a post is approved by a moderator? I’ve tried wpforo_after_update_post and wpforo_after_approve_post, but they don’t seem to work in my setup (wpForo version [2.1.6]).

Thank you for your help!

Best regards, Stanislav

Topic Tags
2 Replies
Robert
Posts: 10600
Admin
(@robert)
Support Team
Joined: 9 years ago

Hi @aima-forum ,

You can use the wpforo_post_status_update action hook, it has two parameters:

do_action( 'wpforo_post_status_update', $post, $status );

Please note that if $status === 1 the post is unapproved, if it's $status === 0 the post is approved.

1 Reply
st7878
(@aima-forum)
Joined: 5 years ago

Estimable Member
Posts: 115

@robert Thank you. You helped me a lot. This is what I needed.