Blocksy v2+ breaks WP REST API
-
Just a heads up to those seeing weird behaviour out of the WordPress REST API after upgrading Blocksy v2.0.x. BTW, I opened a ticket with creativethemes.com but that might be just for paid users : (
** What’s wrong:
It looks like the v2 Blocksy theme is breaking the WP REST API, specifically it looks like the query parameters on API calls are now being blocked/ignored/dropped. I have confirmed this on 3 websites.Specifically, I have the following API call that lists all Posts that have a specific Tag assigned to it. I set this up on a test website to demonstrate:
https://<secret>.dreamhosters.com/wp-json/wp/v2/posts?per_page=100&status=publish&tags=2&context=edit&orderby=dateWith Blocksy v 1.9.11 (and anything prior), this call would work properly and return a single post, as expected. “&tags=2” states that I want all Posts with Tag id=2 attached to them. I only have 1 such Post so I normally only get 1 Post back.
When I upgraded to v2, 2.0.1, or 2.0.2, this call now returns all Posts, which is wrong.
** What’s going on:
The REST API is now ignoring the “&tags=2” parameter. It’s also ignoring the “&per_page=100” parameter (seems to depend on the total Post count on the website though – not sure why). The Posts that are returned also include those in a “draft” state, despite me stating “&status=publish”.When I use “WP Rollback” and reinstall Blocksy 1.9.11, or change to another theme (ie: Twenty Twenty-Four), the above call starts working again. When I roll-back Blocksy, I always rolled-back the Blocksy Companion, though the issue is definitely tied to the theme. I also have the Blocksy child theme installed.
**Installed plugins:
Application Passwords v0.1.3
Blocksy Companion v2.0.1
WP Rollback v1.7.3
WP Super Cache v1.11.0
The topic ‘Blocksy v2+ breaks WP REST API’ is closed to new replies.
