Example (the issue amplified by the block editor):
// Ask WordPress for its tags, using the taxonomy slug.
wp.data.select( 'core' ).getEntityRecords( 'taxonomy', 'post_tag' );
// And WordPress asks itself for its tags using the taxonomy rest_base
// https://plugins.test/wp-json/wp/v2/tags?context=edit
// Ask WordPress for posts with an associated term using the taxonomy rest base.
wp.data.select( 'core' ).getEntityRecords( 'postType', 'my_cpt', { tags: [ 123 ] } );
// And WordPress passes the parameters as provided
// https://plugins.test/wp-json/wp/v2/my_cpt?context=edit&tags%5B0%5D=123
I’m mostly publishing this because I’ll forget one day. 🙂
In hindsight, IMO, one thing about the WP REST API that could have been left out is the attempt to rename stuff so that it was more readable/friendly.
Today, it was having to juggle “IN, AND” versus “OR, AND” in a taxonomy query and then having to add an entire other parameter to _exclude
terms instead of using NOT IN.
Not too long ago it was juggling a different rest_base
for tag
instead of post_tag
.
It’s possible this would all be fine if we were only consuming the API, but bouncing back and forth between block editor JS, its consumption of the API, and corresponding PHP customizations can make things strange.

On one hand, I would like to commend a previous homeowner for their commitment to a stable fence pole.
On the other, I’d like to register a complaint about their commitment to a stable fence pole. 😅
You can now add a fediverse handle to your WordCamp US (and hopefully other WordCamps?) attendee profile. 💯
Thank you! I’ve been meaning to debug why my alt text hasn’t been coming over and this very much sounds like a plausible reason. I’ll give it a shot soon!
Okay, I built a WPHTML Converter that can be used to transform WordPress block markup to its JS or PHP formats.
I’m sure there are bugs. If you find them, let me know!
Bonus: I renewed the expired cert on air.jeremyfelt.com a couple months early this year 😎
I had a dream about a new word game about a month ago and, even though I never wrote it down, it somehow stuck in my brain.
I finally wrote a POC on paper today and it was fun. Time to build a word game! 🙃