Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WP REST API v2 Support #14

Open
jakejackson1 opened this issue Oct 26, 2015 · 13 comments
Open

Add WP REST API v2 Support #14

jakejackson1 opened this issue Oct 26, 2015 · 13 comments

Comments

@jakejackson1
Copy link

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
Copy link

Jany-M commented Feb 3, 2016

+1

4 similar comments
@crazyyy
Copy link

crazyyy commented Feb 4, 2016

+1

@proweb
Copy link

proweb commented Feb 27, 2016

+1

@michaelnagy
Copy link

+1

@djmtype
Copy link

djmtype commented Jul 8, 2016

+1

@tyrann0us
Copy link

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

@Drivingralle
Copy link

+1

@Jany-M
Copy link

Jany-M commented Feb 25, 2017

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
Copy link

djmtype commented Apr 25, 2019

@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
Copy link

Jany-M commented Apr 25, 2019

@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
Copy link

djmtype commented Apr 25, 2019

@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
Copy link

Jany-M commented Apr 26, 2019

@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
Copy link

djmtype commented Apr 26, 2019

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

I'll try it with my CPT later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants