Jeremy Felt

In reply to: my earlier gripe

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. 🙂

Published

Back to all notes.

Jeremy's profile photo: a selfie taken while walking through Berlin.

Jeremy Felt wrote this and published it on the internet.

Unless otherwise expressly stated, the content above is licensed under a CC BY-SA 4.0 International License.

Leave a Reply

Your email address will not be published. Required fields are marked *

The only requirement for your mention to be recognized is a link to this post in your post's content. You can update or delete your post and then re-submit the URL in the form to update or remove your response from this page.

Learn more about Webmentions.