Title: Small code refactor and filter
Last modified: September 9, 2021

---

# Small code refactor and filter

 *  [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/small-code-refactor-and-filter/)
 * David, Ryan, and team,
 * Firstly great plugin. I have one developer driven feature request that should
   be simple to deliver.
 * Basically that you separate out the static function create in class-micropub-
   endpoint.php, into two seprarte functions.
 * The first should prepare all the arguments and the sec ond should actually insert
   the data into the database. The second function should then have an additional
   filter right before wp_insert_post to allow for the indeiweb content to be inserted
   into another table, rather than wp_posts.
 * My use case being that I want to integrate buddypress with micropub, and as such
   I want to map some of the indeweb content types into buddypress type activities
   which involves inserting them into a different table.

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

 *  Plugin Author [David Shanske](https://wordpress.org/support/users/dshanske/)
 * (@dshanske)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/small-code-refactor-and-filter/#post-14862263)
 * [@shawfactor](https://wordpress.org/support/users/shawfactor/) Happy to work 
   on this. Made a note of it as a Github issue on our repository at [https://github.com/indieweb/wordpress-micropub/issues/252](https://github.com/indieweb/wordpress-micropub/issues/252)
 *  Plugin Author [David Shanske](https://wordpress.org/support/users/dshanske/)
 * (@dshanske)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/small-code-refactor-and-filter/#post-14896108)
 * [@shawfactor](https://wordpress.org/support/users/shawfactor/) The latest update
   adds the insert filter. However, there is no update filter at this time. Wanted
   to check to see what you needed.
 *  Thread Starter [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/small-code-refactor-and-filter/#post-14896641)
 * thankyou!
 * But yes yoiu are right, having a look tjrough the code I’d need to be able to
   filter create, update, dleete, undeleet and the returned url.
 * No hurry but do you think that is achievable?
 * Pete

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

The topic ‘Small code refactor and filter’ is closed to new replies.

 * ![](https://ps.w.org/micropub/assets/icon.svg?rev=3102075)
 * [Micropub](https://wordpress.org/plugins/micropub/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/micropub/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/micropub/)
 * [Active Topics](https://wordpress.org/support/plugin/micropub/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/micropub/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/micropub/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/small-code-refactor-and-filter/#post-14896641)
 * Status: not resolved