WPGraphQL for Advanced Custom Fields Now Available for Free

WPGraphQL for Advanced Custom Fields Now Available for Free

The WPGraphQL for Advanced Custom Fields plugin is now available for free on GitHub after a short time as a commercial product. Jason Bahl, creator and maintainer of the WPGraphQL project, released the extension in April 2019 with a pricing tier ranging from $49/annually (for one site’s support) to lifetime subscription options.

Bahl created the plugin with the hopes of generating enough revenue to one day fund his efforts working on WPGraphQL full-time. Now that he has joined the Gatsby team to work full time on WPGraphQL, he has the time and resources to make the ACF extension available for free.

The plugin allows developers to interact with their ACF data using GraphQL queries. It works with both the free and pro versions of ACF and WPGraphQL v0.3.2 or newer.

“When I first started working on the core WPGraphQL plugin, I thought it would be awesome to have meta fields automatically exposed to the WPGraphQL Schema,” Bahl said.

“Since WordPress core doesn’t have a fields API, developers turn to plugins such as Advanced Custom Fields, Metabox.io, CMB2, Carbon Fields, Field Manager, or one of the many other metabox solutions for WordPress.”

ACF is by far the most popular among these solutions with more than a million active installs. (Metabox.io has roughly half the user base with 400,000+ installs and CMB2 is the next most popular at an estimated 200,000 installs). Bahl started working towards supporting ACF a few years ago but didn’t have a production use case for it and left it untouched until demand for the plugin increased.

“In the latter half of 2018 and early 2019 I got many requests via Slack, Twitter, and Github for a quality ACF extension, and I also noticed the top search terms on the WPGraphQL website were ‘ACF’ and ‘Advanced Custom Fields,’ he said.

“I initially wanted to release the plugin as a free plugin, but there’s only so much I can do for free. Maintaining WPGraphQL on the side of my full-time job was already time consuming and I thought if I was making income I could support it better.”

Since the plugin’s initial release on April 19, Bahl reports there have been 85 licenses purchased, which enabled him to devote more time to the project. Now that he is no longer attempting to self-sustain his projects, he and the Gatsby team decided the best course of action would be to make it free so that more of the community can benefit from the project. He anticipates being able to provide the same level of support since the plugin’s launch with more of his time allocated to focusing on the WPGraphQL ecosystem.

Performance is the most common reason that necessitates developers using ACF to implement WPGraphQL on their sites. It offers staggering performance gains over using the WP REST API to query ACF data, as shown in the example below:

“When developers try to build “headless” applications with WordPress, they often run into pain points with the WP REST API, and they turn to WPGraphQL to ease those pains,” Bahl said.

“Many developers were registering ACF fields to their WPGraphQL Schema by hand, and that can be a tedious process if you have hundreds of fields. A plugin like WPGraphQL for Advanced Custom Fields saves developers a lot of development time, and allows them to take advantage of the features of GraphQL that make headless WordPress development a pleasant experience.”

WPGraphQL for Advanced Custom Fields can be found on GitHub and support and feature requests are handled through Github issues. The plugin is also available on packagist.org for those who want to include it in projects using Composer.

Developers with general questions can join the WPGraphQL Slack workspace or the project’s online community on Spectrum. Bahl is active in both communities, helping developers find answers to their questions about using WPGraphQL to build headless applications.

Would you like to write for WP Tavern? We are always accepting guest posts from the community and are looking for new contributors. Get in touch with us and let’s discuss your ideas.
Advanced Custom Fields 5.8.0 Introduces ACF Blocks: A PHP Framework for Creating Gutenberg Blocks

Advanced Custom Fields 5.8.0 Introduces ACF Blocks: A PHP Framework for Creating Gutenberg Blocks

After six months in development, Advanced Custom Fields 5.8.0 was released yesterday with a new PHP-based framework for developing custom Gutenberg block types. ACF Blocks was announced in October 2018, to the great relief of many developers who didn’t know how they were going to keep pace with learning the JavaScript required to use WordPress’ Block API.

ACF’s creator, Elliot Condon, was one of the more vocal critics of Gutenberg leading up to its inclusion in WordPress 5.0. Developers were concerned about whether or not their custom metaboxes generated by ACF would still be compatible. The ACF team worked to ensure the plugin was integrated into the Gutenberg UI as much as possible and surprised users by announcing an acf_register_block() function that would allow developers to use PHP to create custom blocks.

The new ACF Blocks add-on is built on top of Advanced Custom Fields Pro and does not require any JavaScript knowledge. It integrates with custom fields so developers can create custom solutions. ACF blocks are rendered using a PHP template file or a callback function that allows full control of the output HTML and live previews while editing the blocks. They also maintain native compatibility with WordPress core, meaning that all Gutenberg features like “alignment” and “re-usable blocks” work as expected.

Early feedback indicates that ACF Blocks has made custom Gutenberg development more approachable for developers who are not as well-versed in React, significantly speeding up the creation of custom blocks.

This is one example of how the WordPress product ecosystem continues to evolve to support developers in the transition to a more JavaScript-powered WordPress.

ACF Blocks also launched with a suite of nine ready-to-use bocks available as a plugin from the new acfblocks.com website. These include commonly-requested functionality for client sites, such as testimonial, team, multi-button, star-rating, pricing list, and click-to-tweet, with more on the way.

Would you like to write for WP Tavern? We are always accepting guest posts from the community and are looking for new contributors. Get in touch with us and let’s discuss your ideas.