
Airpress is a WordPress plugin that integrates Airtable with WordPress, allowing you to use Airtable data the way you want.
Airpress comes with two built-in extensionsâVirtual Fields and Virtual Postsâboth of which are used to map certain WordPress objects or URLs to Airtable records (one to one or one to many or many to many). Records that are automatically requested are stored in the variable $post->AirpressCollection
<?php $e = $post->AirpressCollection[0]; echo $e["Name"].": ".$e["Start Date"]."<br>"; ?>
or you can use the shortcode wherever shortcodes are allowed:
[apr field="Name"]: [apr field="Start Date"]
Airpress can be used to manually request records from Airtable by specifying the desired table, view, filter, sort, etc.
<?php $query = new AirpressQuery(); $query->setConfig("default"); $query->table("Events")->view("Upcoming"); $query->addFilter("{Status}='Enabled'"); $events = new AirpressCollection($query); foreach($events as $e){ echo $e["Name"].": ".$e["Start Date"]."<br>"; } ?> Both manual and automatic requests can be configured and used entirely within the WordPress admin dashboard or entirely via PHP code.
Related records may easily be retrieved both in PHP code and via shortcodes. When a related/linked field is âpopulatedâ, the linked records actually replace the corresponding RECORD_ID().
Consider a base with two related tables: Events and Locations, if you populate the âEventsâ field of the Locations collection, it goes from being an array of RECORD_ID()s to an AirpressCollection with AirpressRecords.
[apr_populate field="Location" relatedTo="Locations"] [apr_populate field="Location|Owner" relatedTo="Contacts"] [apr name="Name"] at [airfield name="Location|Name"] owned by [airfield name="Location|Owner|Name"] <?php $events = $post->AirpressCollection(); $linked_field = "Location"; $linked_table = "Locations"; $events->populateRelatedField($linked_field, $linked_table); // You can even populate linked fields of linked fields! $events->populateRelatedField("Location|Owner", "Contacts"); echo $events[0]["Name"]." at "; echo $events[0]["Location"][0]["Name"]." owned by"; echo $events[0]["Location"][0]["Owner"][0]["Name"]."<br>"; ?> You may also specify a complete query with which to retrieve the linked records. For example, if you want to find all upcoming Events for a particular Location:
// default is the name of the Airtable Connection configuration $query = new AirpressQuery("Locations", "default"); $query->filterByFormula("{Name}='My Local Pub'"); $locations = new AirpressCollection($query); $query = new AirpressQuery("Events", "default"); $query->filterByFormula("IS_BEFORE( TODAY(), {Start Date} )"); $locations->populateRelatedField("Events", $query); This will update each record in the $locations collection with associated events that are after TODAY(). Any other linked events will be removedâNOT from the Airtable record, just from the $locations collection.
There are two reasons why AirpressCollections should be used even when dealing with just a single AirpressRecord.
Both AirpressCollection() and AirpressRecord() are PHP ArrayObjects. This means that they behave like arrays even though they can store custom properties and methods as well. So for an AirpressRecord $r[âField Nameâ] and $r->record_id() both work! This allows easy foreach iteration through records and fields while allowing custom methods as well.
Airpress needs better documentation regarding how it âimplodesâ fields from multiple records when using the shortcodes and AirpressCollection methods.
Airtable Connections store your API credentials and allow Airpress to âtalkâ to the Airtable API. Youâll need to enter your API KEY and APP ID.
Multiple connections to the same base can be used if you want different multiple caching or logging settings. For example, you may have a single base but you want all requests made to the Events table to be refreshed every 5 minutes, however any requests made to the Locations table only need to be refreshed daily.
The name you give the connection is how youâll refer to this Connection from other settings pages and in any PHP code you write. (You can also refer to the first connection configuration numerically using a zero-based index).
<?php $query = new AirpressQuery(); $query->setConfig("default"); $query->table("My Airtable table name"); ?> Since version 1.1.46 the AirpressQuery has the hasErrors() and getErrors() methods that should be used when doing any syncing operations as Airtable doesnât have a perfect âuptimeâ record and you donât want to sync empty results just because your request either timed out or return a 422 error or something.
<?php $query = new AirpressQuery("My Table Name",0); $records = new AirpressCollection($query); if ( $query->hasErrors() ){ print_r($query->getErrors()); print_r($query->toString()); // or $code = $errors[0]["code"]; $message = $errors[0]["message"]; $string = $query->toString(); } else if ( is_airpress_empty($records) ) { // Query was fine, just returned no results } else { // Do something with $records } ?> The Airpress cache saves the results of each Airtable API request using a hash of the request parameters. Each subsequent identical request will be served from the local database.
When a cached request is no longer considered âfreshâ, the cached result will be served one last time while the cache is updated asynchronously in the background so as not to slow the page load.
If a cached request has expired completely, then the page load will wait for âfreshâ data to be requested.
Airpress gives you control over what is considered âfreshâ and âexpiredâ data via these two variables:
Refresh: The number of seconds after which Airpress will perform a background refresh on a cached Airtable API request.
Expire: The number of seconds after which Airpress will no longer serve the cached request.
Query var to force refresh: During development (and even while in production) it can be extremely helpful to force Airpress to load all requests directly from Airpress. Hosts like GoDaddy and MediaTemple already provide a query var to flush the cache, so if you set Airpressâ force refresh to the same var, you can flush everything at once.
Assuming âRefreshâ is set for five minutes and âExpireâ is set for an hour:
Airpress plays nicely with object caches and page caches. Please note that some hosts aggressively purge the transient cache (which is where cached requests are stored) resulting in more requests than might be expected. Also, if you have a page cache that bypasses PHP and directly serves cached HTML, then obviously Airpress wonât be able to check the âfreshnessâ of the data until the cached page is regenerated.
Starting from $0 per month.
Rating
Reviewers
12 reviews
Tags
Developed By
chetmac
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features â so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Show Etsy reviews to build trust, strengthen credibility, and help visitors make confident purchase decisions that support higher sales.
Add social media and RSS feeds to your site to display fresh content, grow your online presence, and keep visitors engaged with real-time updates.
Add an events calendar to your site so visitors can view upcoming activities, improving engagement and event visibility.
Showcase content with a card slider that presents images, text, and buttons in a smooth, customizable layout to keep visitors engaged.
Create secure HIPAA compliant forms that protect sensitive data, offer full customization, and integrate easily for safe medical information collection.
Add a no-code music player to your site to stream audio, share playlists, and support multiple formats with easy setup.
A scroll to top button that helps visitors move back to the top of long pages quickly, improving navigation and overall browsing flow.
Scroll to element button that improves navigation by letting visitors jump directly to key sections, reducing friction and boosting overall engagement.
Show LinkedIn posts with a LinkedIn feed carousel that auto updates, presents content in a smooth layout, and keeps visitors engaged.
Manage appointments with an appointment booking widget that lets visitors schedule easily, syncs calendars, sends reminders, and creates a smoother booking experience.
Show Instagram posts in a responsive carousel layout to enhance social proof and keep your site content visually fresh.
Use image hover effects to add animations, highlight key visuals, and keep visitors engaged with dynamic image reveals.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
