AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Closed] List of Hooks

4 Posts
2 Users
0 Reactions
3,057 Views
Posts: 58
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@aaronmckeon)
Trusted Member
Joined: 4 years ago
[#23985]

I need to create one custom function that performs an action when a topic or post is created, as well as one if it is deleted.  These are the only hooks I've been able to come across by searching the forum:

  • 'wpforo_after_add_topic' - arg: (array)$topic
  • 'wpforo_start_edit_topic' - arg: (array)$topic
  • 'wpforo_after_add_post' - args: (array)$post, (array)$topic
  • 'wpforo_start_edit_post' - args: (array)$post

Can you confirm if the after_add ones are the correct ones to use?  What happens if a post is held for moderation?  Does the hook only fire when it's published?  Also, what hook would I use for if the post is deleted?  Am I to interpret from above that the post and/or topic ID's are the arguments being passed as $post and $topic?  Thanks for clarifying.

-- Aaron


Topic Tags
3 Replies
Robert
Posts: 10746
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 3 months ago

Hi @aaronmckeon,

This works for topics and posts. So this hook is triggered in both cases:

'wpforo_after_add_post' - args: (array)$post, (array)$topic


2 Replies
(@aaronmckeon)
Joined: 4 years ago

Trusted Member
Posts: 58
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@robert - Thanks!  That worked great.  Can you tell me if there is one for after a post is deleted?


Robert
Admin
(@robert)
Joined: 3 months ago

Support Team
Posts: 10746
Robert
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@aaronmckeon,

'wpforo_after_delete_post' - args: (array) $post


Share: