I’m trying to expand the functionality of sending a message and announcement. I would like to add another notification when creating a message or announcement. I’ve created another plugin to hook into the functions.
I’ve found out how to do this with sending messages with the following:
add_action( 'fep_action_message_after_send', 'send_sms_with_twilio', 100, 3 );
function send_sms_with_twilio( $message_id, $message, $inserted_message ){ }
This works perfectly. Then I tried this for announcements with the following:
add_action( 'fep_action_announcement_after_added', 'send_something', 100, 3 );
function send_something( $message_id, $message, $inserted_message ){ }
The above works when sending an announcement in the frontend (url: /inbox/?fepaction=new_announcement). But the problem is this doesn’t work when sending an announcement in the backoffice (url: wp-admin/post-new.php?post_type=fep_announcement).
How can I make it work with the backoffice?