CalderaWP / searchwp-api-route

Adds an endpoint to the WordPress REST API for searching via SearchWP
33 stars 15 forks source link

added filter to allow custom item responses via theme hooks #4

Closed rlaan closed 8 years ago

rlaan commented 8 years ago

Hi Josh,

I'm working on a project which involves querying a remote api to search in a bunch of CPT's with data. The searching is done through SearchWP, so I was glad to see your Rest API plugin for this to work.

Since the CPT's structures are not regular posts or pages and involve meta fields en connections to other CPT's (with posts-to-posts), I needed a way different reponse object than the regular one provided normally.

I saw a filter way more downstream to allow for this (restprepare{$this->post_type}). However since I couldn't find any way to prevent WP to do all this 'work' and then throw it all away later, I thought this early escape path might come in handy.

Please have a look at this pull request and let me know what you think of it.

Thanks, Ruud

Shelob9 commented 8 years ago

@rlaan Sorry, just saw this. It's a capital idea. Merged!

rlaan commented 8 years ago

Hi Josh,

Thanks for merging my pull-request, nice!

Anyways: i'm using my forked version i a project, and thought it would be better to use your latest version instead now that this filter was merged.

Do you perhaps have time to release a new tag for your plugin, so that I can reference that version in my composer.json file? That would be great.

Thanks, Ruud

On Fri, Aug 19, 2016 at 8:07 PM, Josh Pollock notifications@github.com wrote:

@rlaan https://github.com/rlaan Sorry, just saw this. It's a capital idea. Merged!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CalderaWP/searchwp-api-route/pull/4#issuecomment-241092059, or mute the thread https://github.com/notifications/unsubscribe-auth/AMY59PJxCJ5AuOpU3BuKhc_M_0hcRsiRks5qhfD9gaJpZM4I8mMn .