rpwe breaks wp-json posts API output
-
Hello!
We use RPWE to nicely format lists of posts on our company’s support website (WordPress, naturally). It works great.I recently started implementing a third-party tool that calls the WP API to search for posts based on a (string) search term. The query looks like this:
https://mysite.com/wp-json/wp/v2/posts?search=asdf
And the result is supposed to be a nice json array of posts.However…and this is the strange part… Somehow, RPWE is getting in the way and ouputting a chunk of CSS into the result, right at the top. Since the caller is expecting json only, it breaks our integration.
I’ve tried playing around in the RPWE plugin code–I see the exact line where it inserts that CSS, and I added some “if” logic to only output the CSS if a certain shortcode attribute were present. The results are strange: if I call the API directly, right after loading a WP page with RPWE on it, it still fails (as if RPWE remembers being loaded from the UI).
Am I missing something obvious? I’m not a WP expert (C# and javascript is my trade), so maybe there’s just some setting I need to know about….?
Thanks in advance!
The topic ‘rpwe breaks wp-json posts API output’ is closed to new replies.