Title: Notification doesn&#8217;t work
Last modified: December 8, 2022

---

# Notification doesn’t work

 *  [VisedFAQ](https://wordpress.org/support/users/visedfaq/)
 * (@visedfaq)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/)
 * Hi there. We are using a custom LMS plugin for a project, and we have a custom
   post type which is updated with new posts when users add their data on the front-
   end. For some reason, your notification doesn’t fire for both ‘post-type added’
   and ‘post-type published’ triggers. I found a PHP function in the LMS plugin 
   that is responsible for adding user data as a post to this custom post type, 
   can I somehow use existing ‘post-type added’ trigger inside this function? So,
   I don’t need to create a custom trigger.
 * Meaning, if this function runs successfully, fire the trigger ‘post-type added’.
    -  This topic was modified 3 years, 6 months ago by [VisedFAQ](https://wordpress.org/support/users/visedfaq/).

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/#post-16272127)
 * Hi, looks like the action from the plugin might be running too early before our
   plugin initializes.
 * Can you identify if the function responsible of saving the post data in the LMS
   plugin does any `do_action()` call? If yes, we might be able to hook into it 
   and using a simple “proxy” approach pass it to our plugin
 *  Thread Starter [VisedFAQ](https://wordpress.org/support/users/visedfaq/)
 * (@visedfaq)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/#post-16272157)
 * I can’t find a `do_action()` call inside a function, but I think we can create
   one if needed?
 * I can see that the post is created via the `wp_insert_post` function there.
 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/#post-16272183)
 * If it’s a 3rd party plugin, you won’t be able to add it, as it will be overwritten
   by the update (unless you fork the plugin, which is not recommended). Or is the
   plugin your own, and you can edit its codebase?
 *  Thread Starter [VisedFAQ](https://wordpress.org/support/users/visedfaq/)
 * (@visedfaq)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/#post-16272194)
 * Plugin isn’t updated often, and I’ll make a note to myself that when it’s updated,
   I need to add some code again, so don’t worry about it. It’s much more important
   to us to add this notification.
 *  Thread Starter [VisedFAQ](https://wordpress.org/support/users/visedfaq/)
 * (@visedfaq)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/#post-16274491)
 * Any update?
 *  Thread Starter [VisedFAQ](https://wordpress.org/support/users/visedfaq/)
 * (@visedfaq)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/#post-16284487)
 * [@kubitomakita](https://wordpress.org/support/users/kubitomakita/) Hello, so 
   how do we add it?
 *  Plugin Author [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/)
 * (@kubitomakita)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/#post-16296453)
 * Hey, thanks for your patience.
 * What you’ll need to do is add an action **after** the plugin saves all the data,
   like:
 *     ```wp-block-code
       do_action( 'notification_proxy_fsn4f58', $post_id )
       ```
   
 * Where `$post_id` is the saved post.
   Then you’d need to define the proxy action,
   like this:
 *     ```wp-block-code
       add_action( 'notification_proxy_fsn4f58', function( $post_id ) {
           add_action( 'init', function() use ( $post_id ) {
               // Post added action, that trigger is listening for.
               do_action( 'wp_insert_post', $post_id, get_post( $post_id ), false );
           }, 100 );
       }, 10, 1 );
       ```
   
 * I hope this makes sense and will work in your case!
    -  This reply was modified 3 years, 5 months ago by [Kuba Mikita](https://wordpress.org/support/users/kubitomakita/).
      Reason: formatting
 *  Thread Starter [VisedFAQ](https://wordpress.org/support/users/visedfaq/)
 * (@visedfaq)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/#post-16304296)
 * [@kubitomakita](https://wordpress.org/support/users/kubitomakita/) Hello mate.
   I did everything as you said, I’ve tried adding the last code segment to different
   files, functions.php or in the plugin file before all other actions and functions–
   it doesn’t work, unfortunately. No email notification or even error log. 
   Also,
   I thought about the Hash value of the notification I’ve created:
 * ![](https://i0.wp.com/i.imgur.com/VCi410l.jpg?resize=537%2C138&ssl=1)
 * Is there a way to utilize it after the main function is finished, so we can fire
   the notification effectively this way?

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Notification doesn’t work’ is closed to new replies.

 * ![](https://ps.w.org/notification/assets/icon-256x256.gif?rev=3476901)
 * [Notification - Custom Notifications and Alerts for WordPress](https://wordpress.org/plugins/notification/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/notification/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/notification/)
 * [Active Topics](https://wordpress.org/support/plugin/notification/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/notification/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/notification/reviews/)

## Tags

 * [trigger](https://wordpress.org/support/topic-tag/trigger/)

 * 8 replies
 * 2 participants
 * Last reply from: [VisedFAQ](https://wordpress.org/support/users/visedfaq/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/notification-doesnt-work-2/#post-16304296)
 * Status: not resolved