Title: Hook into post_edit_entry function
Last modified: November 1, 2017

---

# Hook into post_edit_entry function

 *  Resolved [tbare](https://wordpress.org/support/users/tbare/)
 * (@tbare)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/hook-into-post_edit_entry-function/)
 * Is there a good way to hook into a function? I have some custom code I added 
   to an older version, and I’d like to update the plugin, but don’t want to have
   to manually add my code after each update. Wondering if there’s a way I can add
   my own plugin that hooks in after the post_edit_entry” function, and where I 
   can pass the original_entry_id.
 * Any tips would be appreciated.

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

 *  Plugin Author [fried_eggz](https://wordpress.org/support/users/fried_eggz/)
 * (@fried_eggz)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/hook-into-post_edit_entry-function/#post-9647694)
 * Good idea. I have added two actions, the first one fires after an entry has been
   edited and the second one after an entry has been deleted.
 * `do_action( 'entry_deleted', $entry )`
 * `do_action( 'entry_edited', $old_entry, $new_entry )`
 * In your case you can use the second hook like so
 *     ```
       add_action('entry_edited','my_entry_edited_function', 10, 2 );
       function my_entry_edited_function($old_entry, $new_entry) {
           $original_entry_id = $old_entry['id']
       }
       ```
   
    -  This reply was modified 8 years, 6 months ago by [fried_eggz](https://wordpress.org/support/users/fried_eggz/).
    -  This reply was modified 8 years, 6 months ago by [fried_eggz](https://wordpress.org/support/users/fried_eggz/).
 *  Thread Starter [tbare](https://wordpress.org/support/users/tbare/)
 * (@tbare)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/hook-into-post_edit_entry-function/#post-9647832)
 * This is exactly what I needed. Thank you! Worked perfect.
 *  Plugin Author [fried_eggz](https://wordpress.org/support/users/fried_eggz/)
 * (@fried_eggz)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/hook-into-post_edit_entry-function/#post-9647910)
 * No problems. Good feature request. If you like the plugin please consider writing
   a short review. Thank you.
 *  Plugin Author [fried_eggz](https://wordpress.org/support/users/fried_eggz/)
 * (@fried_eggz)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/hook-into-post_edit_entry-function/#post-9658845)
 * Just an update [@tbare](https://wordpress.org/support/users/tbare/). I’ve had
   to change the name of the hooks implemented due to possible naming collisions.
   Actions are now called:
 * `do_action( 'stickylist_entry_deleted', $entry )`
 * `do_action( 'stickylist_entry_edited', $old_entry, $new_entry )`
 * Watch out for this if you update to 1.4.5+
 *  Thread Starter [tbare](https://wordpress.org/support/users/tbare/)
 * (@tbare)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/hook-into-post_edit_entry-function/#post-9670204)
 * Thanks for the heads up. Got my code fixed.

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

The topic ‘Hook into post_edit_entry function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gravity-forms-sticky-list_9b65b3.
   svg)
 * [Gravity Forms Sticky List](https://wordpress.org/plugins/gravity-forms-sticky-list/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-sticky-list/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-sticky-list/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-sticky-list/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-sticky-list/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-sticky-list/reviews/)

## Tags

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

 * 5 replies
 * 2 participants
 * Last reply from: [tbare](https://wordpress.org/support/users/tbare/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/hook-into-post_edit_entry-function/#post-9670204)
 * Status: resolved