Working with Gutenberg and the WordPress REST API

In this article I take the Select2 component that I previously added to my Gutenberg plugin, and make it dynamic by taking advantage of the WordPress REST API. This code borrows heavily from the Secure Blocks for Gutenberg plugin. In this example we will be making the ‘Select Roles’ Inspector use dynamic data from the …