bearded-avenger / wp-live-search

A live search plugin for WordPress that utilizes REST API + Backbone + Underscore
http://nickhaskins.com/wp-live-search/
GNU General Public License v2.0
101 stars 13 forks source link

Add WP REST API v2 Support #14

Open jakejackson1 opened 9 years ago

jakejackson1 commented 9 years ago

The routes are changes in the WP REST API v2 (currently being merged into the WP core) which would need to be addressed. Also, custom post type endpoints don't run through the 'post' endpoint any more and don't work when used in the shortcode 'type' attribute.

Jany-M commented 8 years ago

+1

crazyyy commented 8 years ago

+1

proweb commented 8 years ago

+1

michaelnagy commented 8 years ago

+1

djmtype commented 8 years ago

+1

tyrann0us commented 7 years ago

@bearded-avenger, are you still maintaining this plugin? Without support for REST API v2 this plugin is useless. Thanks!

Drivingralle commented 7 years ago

+1

Jany-M commented 7 years ago

If anyone's interested in an updated version of this plugin, I forked it and made it compatible with WP 4.7.2 and the most recent API. Also, some changes were made to accomodate multiple post type requests (since the newer API versions were pretty different, and that wasn't working anymore either). Shortcodes still work like they did. Also, there's a Relevanssi plugin compatibility fix inside as well (since the 2 are not compatible together out of the box).

@bearded-avenger I can take over the WP repo plugin if you like? just add me as contrib/author so I can update it for everybody else as well đź‘Ť

djmtype commented 5 years ago

@Jany-M did you every release a working version? Your forked page doesn't allow us to post issues to let you know this plugin is not working with WP 5.1.1 using the same logic we used with WP Live Search v.9: [wp_live_search multi="true" type="my-cpt,post,page"] Your v2.0 seems to only search posts.

Oddly, version v.9 still works when the old v1.2.5 WP API is enabled. Although, that seems rather silly.

Jany-M commented 5 years ago

@djmtype my version was working perfectly fine up until at least 4.8. Have not tested it with a newer version though. If it's not working, it might have to do with changes in the API, however I'm pretty sure the API hasn't changed dramatically in recent times. The fork was necessary exactly because of significant changes in the API at the time, causing the original version to stop working altogether. Have you given it a try?

djmtype commented 5 years ago

@Jany-M I get 404 errors that the search term can not be found. The search terms I try are either in a page or custom post type. So, while searching terms in a post does work, they do not work for page or my-custom-post-type.

Jany-M commented 5 years ago

@djmtype that sounds like a routing issue. There are no 404 in case of no results. Make sure that you are getting results by testing eg. http://yoursite.com/wp-json/wp/v2/pages and your cpt. Also, I'm assuming you are using my fork, right?

djmtype commented 5 years ago

Hi @Jany-M, looking at the routing… page needs to be pages, then it works!

I'll try it with my CPT later.