The easiest way to see Remote Data Blocks in action is to launch the plugin in WordPress Playground.
However, the more advanced use case is providing your own custom configuration through code. This guide will walk you through the steps to do this.
Download the latest release of the plugin, unzip, and add it to the plugins/
directory of your WordPress site.
In the WordPress admin, go to Settings > Remote Data Blocks and click Connect new. Give the data source a display name and enter https://api.zippopotam.us/us/
as the URL. Save the data source.
Back on the data source list, click the three dots on the right of the row for your new data source and copy the UUID.
Copy the zip code data source example into your /plugins
directory, set EXAMPLE_ZIP_CODE_DATA_SOURCE_UUID
to the UUID copied above and then activate the plugin titled Zip Code RDB Example
.
Try making changes to the configuration. For example, rename the block in the register_remote_data_block
function call.
Go to the page where you want to use the block and add the block to the page. Click Provide manual input
, enter a US ZIP code and then hit save. Then, choose a pattern to use to display the data on the page.