Reaction Action Hook?
-
Howdy, hoping all is well.
I have some basic PHP knowledge such as accessing arrays, inserting into the database, concatenating, ect and was wondering if there is an action hook for reactions?WordPress comments for example has an action hook that fires immediately after a comment is made which you can send the data off to where you need it:
https://developer.www.ads-software.com/reference/hooks/comment_post/#comment-5362A sample of how the action hook could look like:
function send_reaction( $reaction_id, $reaction_type, $reaction_author, $reaction_link ) {
$reaction = get_reaction( $reaction_id );
$mail = ‘[email protected]’;
$reaction_link = get_reaction( $reaction_link )
$subject = sprintf( ‘New reaction by: %s’, $reaction->reaction_author );
$message = “You have a new ” . $reaction->reaction_type . “at” . $reaction_link;
wp_mail( $mail, $subject, $message );}
add_action( ‘da_reaction’, ‘send_reaction’, 10, 2 );
Ultimately I’m interested in 3 pieces of information being sent into a database record. Reaction type, author, and the link where the reaction happened. Having this would be a dream come true as it would allow me to send notifications for reactions.Warm regards,
Josh
- You must be logged in to reply to this topic.