If you run a Wordpress website and you want to be able to easily pull data from Airtable into Wordpress, this is for you.
Airfields is a Wordpress plugin I’ve built that allows data from Airtable to be accessed using Wordpress’ get_post_meta and get_post_custom functions. There is also a shortcode you can use in the post editor that will output the value of whatever Airtable field you specify.
The way it works is that in the Airfields admin settings you will provide (App ID, API Key and) the name of an Airtable table and a field from that table in which either the post slug or the post ID will be stored. Then, any posts that match will have its custom data populated from the fields of the corresponding record from Airtable. This works with pages, posts, and any custom post type and can be used to display any field type Airtable supports.
This should be considered a beta. If you’re a Wordpress plugin developer interested in helping develop this plugin, let me know. And if you’re interested in testing out the plugin, go for it and let me know what changes you’d like to see.
Here’s what editing a page using shortcodes looks like:
Here’s the output on the website:
Here’s the Base it pulls from:
Here’s a code sample of how to use Airfields inside a PHP template file (the Airtable field as actually named, ‘Attachement’):
<?php $attachment = get_post_meta($post->ID,"Attachment"); echo "<img src='".$attachment["thumbnails"]["large"]["url"]."'>"; ?>