SlideShare a Scribd company logo
Creating Gutenberg Blocks
With ACF
Imran Sayed @imranhsayed
#WCVadodara
#WCVadodara
What are Gutenberg Blocks?
❖ Gutenberg is a block-based editor.
Gutenberg Blocks
#WCVadodara
❖ Every content element (e.g. heading,
paragraph, or YouTube embed) is a
block.
❖ The collection of blocks makes up
the content on the page.
Gutenberg Blocks
#WCVadodara
#WCVadodara
Need for Gutenberg Blocks?
#WCVadodara Problem with the Classic Editor
#WCVadodara How Gutenberg Solved it.
#WCVadodara
Gutenberg Blocks
Design Reuse Editing Experience
#WCVadodara
Types of Blocks
#WCVadodara Core Blocks
#WCVadodara
Block Plugins & Libraries
#WCVadodara WP Form : Block Plugin
#WCVadodara Ultimate Blocks: Block Library
● Content Filter
● Review
● Table of Contents
● Testimonial
● Click to Tweet
● Social Share
● Countdown
● Progress Bar
● Star Rating
● Image Slider
#WCVadodara Ultimate Blocks: Star Rating
#WCVadodara Ultimate Blocks: Review Block
#WCVadodara
Need for building Custom Blocks
Ways of Building Blocks
#WCVadodara
ES5
ES
&
JSX
Next
❖ Learn JavaScript and React.
❖ Requires an extra build step for code
transformation (
@wordpress/scripts can be used )
#WCVadodara
Challenges in building blocks with ES6
❖ ES5 without JSX can run straight in
the browser.
❖ Locating and understanding the
compiled source code is difficult.
#WCVadodara
Challenges in building blocks with ES6
❖ Tooling around JavaScript could be
intimidating.
#WCVadodara
Challenges in building blocks with ES6
#WCVadodara
Step 1: Build- Install @wordpress/scripts
#WCVadodara Step 2: Register Block Server Side
public function register_block() {
…..
// Block editor script.
register_block_type(
'gtcb-blocks/custom-blocks',
[
'style' => 'gtcb-block-front-end-styles',
'editor_style' => 'gtcb-block-editor-styles',
'editor_script' => 'gtcb-block-editor-js',
] );
#WCVadodara Step 3: Register Block Client Side
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
registerBlockType( 'gtcb-blocks/custom-blocks', {
title: __( 'Custom Block', 'custom-blocks' ),
icon: 'megaphone',
category: 'common',
edit: () => ( <div>Hello World</div> ),
save: () => ( <div>Hello World</div> )
} );
#WCVadodara
Can we build blocks without
using JavaScript?
Answer: Yes#WCVadodara
Blocks ( 5.8+ Pro )
ACF Blocks is a PHP framework
that does not require any
JavaScript.
❖ A WordPress plugin.
What is ACF?
#WCVadodara
❖ Allows you to add extra content
fields( custom fields ) to your
WordPress edit screens.
Author : Elliot Condon
Create Field Group#WCVadodara
#WCVadodara
❖ Build website’s faster and educate
your client’s quicker.
❖ Free/ Pro
Features
#WCVadodara
#WCVadodara
Build blocks with ACF
#WCVadodara
WordPress Block API
❖ Install packages
❖ Register Block Server
Side
❖ Register Block Client
Side
Steps Involved
Blocks
❖ Register Block Server
Side
acf_register_block_type()
❖ Create Fields
❖ Load the template
#WCVadodara
WordPress Block API
Difference
Blocks
❖ Client Side or Server
Side
❖ Server Side
❖ Static or Dynamic ❖ Dynamic
#WCVadodara
Testimonial Block using
ACF Blocks
#WCVadodara Create a plugin
mkdir acf-guten-blocks
cd acf-guten-blocks
touch acf-guten-blocks.php testimonial.php
├── acf-guten-blocks.php
├── testimonial.php
#WCVadodara Step 1: Register Block Server Side
function register_block() {
acf_register_block_type( $settings )
}
add_action( ‘acf/init’, 'register_block' );
#WCVadodara Add Settings
$settings = [
'name' => 'testimonial',
'title' => __( 'Testimonial' ),
'description' => __( 'Testimonial block.' ),
'render_template' => 'path/to/testimonial.php',
'category' => 'formatting',
];
#WCVadodara Step 2- Create Fields
Step 3: Load Block Template
( template.php )
#WCVadodara
$block
print_r( $block )
#WCVadodara
#WCVadodara
template.php
Creating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACF
#WCVadodara
Creating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACF
#WCVadodara
Live Preview and Edit Mode
#WCVadodara
🌎 PHP Environment
🎨 Simple Templating
🔌 Custom Fields Compatible
👀 Live Previews
🌈 Native Compatibility
🎉 Anywhere and everywhere
ACF Blocks Features
#WCVadodara
#WCVadodara
Common Questions
● Scope
● Meta boxes save data to
‘postmeta’ table
● ACF Block data is saved
within the “post_content”
as an HTML comment
How are ACF blocks different
from meta boxes?
#WCVadodara
● enqueue_block_assets :
both editor and front-end
● enqueue_block_editor_assets :
editor only
Style block differently in
editor
#WCVadodara
Ways of Building Blocks
#WCVadodara
ES5
ES
&
JSX
Next
❖ Git repo for this example
https://github.com/imranhsayed/acf
-guten-blocks
Git Repo
#WCVadodara
#WCVadodara
ACF - making developers life easy
rtCamp
WordCamp Vadodara - organizing
Elliot Condon - support
Mahvash Fatima - Ppt
Design
Credits
#WCVadodara
rtCamp’s WordPress
Training Program
#WCVadodara learn.rtcamp.com
#WCVadodara
Codeytek Academy
#WCVadodara academy.codeytek.com
#WCVadodara
#WCVadodara
Questions
#WCVadodara
Imran Sayed
imranhsayed

More Related Content

PPTX
Fastest Way of Creating Gutenberg Blocks - WordCamp Rochester
PDF
Create Custom Page Builders with Gutenberg and ACF Blocks
PDF
Demystifying Gutenberg Blocks - Understanding the first steps to becoming a G...
PDF
Ryan Markel - WordCamp StL 2016 - Code Review
PDF
Building your first Gutenberg block
PDF
Knockout js (Dennis Haney)
PDF
WordCamp US 2016 - Ryan Markel: Code Review
KEY
jQuery Mobile Overview - Boston
Fastest Way of Creating Gutenberg Blocks - WordCamp Rochester
Create Custom Page Builders with Gutenberg and ACF Blocks
Demystifying Gutenberg Blocks - Understanding the first steps to becoming a G...
Ryan Markel - WordCamp StL 2016 - Code Review
Building your first Gutenberg block
Knockout js (Dennis Haney)
WordCamp US 2016 - Ryan Markel: Code Review
jQuery Mobile Overview - Boston

What's hot (20)

PDF
A team 43 C
PDF
Discover the power of browser developer tools
ODP
Wade.Go Introduction Speech - SFD HCMC 2014
PDF
jQuery Foundation Keynote
PDF
Your Future HTML: The Evolution of Site Design with Web Components
PPTX
Kentico Cloud Best Practices
PPTX
Choosing a JavaScript Framework
ODP
WordPress, HTML5 and CSS3
PDF
Beginner's Guide to Frontend Development: Comparing Angular, React, Ember, an...
PDF
Movable type-semianar-20111031-ideamans
PPTX
Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery
PDF
Taming Drupal Blocks for Content Editors a.k.a. "Snippets"
PDF
Introduce Angular2 & render & firebase flow
PPTX
Web components. Compose the web.
KEY
Sugarcoating your frontend one ViewModel at a time
PPTX
PPT
Going Mobile
PPTX
JS FAST Prototyping with AngularJS & RequireJS
PDF
Using Node and Grunt to create an awesome workflow
PDF
Windows 8 app template feedback
A team 43 C
Discover the power of browser developer tools
Wade.Go Introduction Speech - SFD HCMC 2014
jQuery Foundation Keynote
Your Future HTML: The Evolution of Site Design with Web Components
Kentico Cloud Best Practices
Choosing a JavaScript Framework
WordPress, HTML5 and CSS3
Beginner's Guide to Frontend Development: Comparing Angular, React, Ember, an...
Movable type-semianar-20111031-ideamans
Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery
Taming Drupal Blocks for Content Editors a.k.a. "Snippets"
Introduce Angular2 & render & firebase flow
Web components. Compose the web.
Sugarcoating your frontend one ViewModel at a time
Going Mobile
JS FAST Prototyping with AngularJS & RequireJS
Using Node and Grunt to create an awesome workflow
Windows 8 app template feedback
Ad

Similar to Creating Gutenberg Blocks With ACF (15)

PPTX
Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge ...
PDF
Gutenberg (WidgiLabs Training Sessions)
PDF
Gutenberg Blocks Development for Programmers with no time
PDF
Blockity McBlock Blocks, Oh My!
PPTX
Getting Started with Gutenberg Development
PDF
Advanced custom fields in Wordpress
PPTX
Introduction to Gutenberg- Imran Sayed
PPTX
Custom gutenberg block development in react
PPTX
Custom gutenberg block development with React
PDF
First steps with Gutenberg for developers - WC Prague 2020
PDF
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
PDF
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
PDF
Creating Custom Gutenberg Blocks for WordPress
PDF
Gutenberg Blocks Development for Programmers with NO time
PPTX
Introduction to WordPress Custom Gutenberg Blocks
Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge ...
Gutenberg (WidgiLabs Training Sessions)
Gutenberg Blocks Development for Programmers with no time
Blockity McBlock Blocks, Oh My!
Getting Started with Gutenberg Development
Advanced custom fields in Wordpress
Introduction to Gutenberg- Imran Sayed
Custom gutenberg block development in react
Custom gutenberg block development with React
First steps with Gutenberg for developers - WC Prague 2020
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
Creating Custom Gutenberg Blocks for WordPress
Gutenberg Blocks Development for Programmers with NO time
Introduction to WordPress Custom Gutenberg Blocks
Ad

More from Imran Sayed (16)

PPTX
Docker with WordPress
PPTX
Why Progressive Web Apps For WordPress - WordCamp Finland
PPTX
Harness The Power Of ACF For Gatsby and WordPress
PPTX
Improving Your Debugging Skills In WordPress
PPTX
Build Modern Web Applications with React and WordPress
PPTX
Why progressive apps for WordPress - WordSesh 2020
PPTX
Digging Into Gutenberg
PDF
Why progressive web apps for word press wc-ahemdabad
PPTX
Build fast word press site in react in 30 mins with frontity
PPTX
Build Fast WordPress Site With Gatsby
PPTX
Why Progressive Apps For WordPress?
PPTX
SSR with React - Connecting Next.js with WordPress
PDF
React with WordPress : Headless CMS
PPTX
React Workshop: Core concepts of react
PPTX
Redux workshop
PPTX
React workshop
Docker with WordPress
Why Progressive Web Apps For WordPress - WordCamp Finland
Harness The Power Of ACF For Gatsby and WordPress
Improving Your Debugging Skills In WordPress
Build Modern Web Applications with React and WordPress
Why progressive apps for WordPress - WordSesh 2020
Digging Into Gutenberg
Why progressive web apps for word press wc-ahemdabad
Build fast word press site in react in 30 mins with frontity
Build Fast WordPress Site With Gatsby
Why Progressive Apps For WordPress?
SSR with React - Connecting Next.js with WordPress
React with WordPress : Headless CMS
React Workshop: Core concepts of react
Redux workshop
React workshop

Recently uploaded (20)

PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
DOCX
The Five Best AI Cover Tools in 2025.docx
PPTX
Introduction to Artificial Intelligence
PPT
JAVA ppt tutorial basics to learn java programming
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
top salesforce developer skills in 2025.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Wondershare Filmora 15 Crack With Activation Key [2025
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Design an Analysis of Algorithms I-SECS-1021-03
Design an Analysis of Algorithms II-SECS-1021-03
Upgrade and Innovation Strategies for SAP ERP Customers
The Five Best AI Cover Tools in 2025.docx
Introduction to Artificial Intelligence
JAVA ppt tutorial basics to learn java programming
How Creative Agencies Leverage Project Management Software.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Odoo POS Development Services by CandidRoot Solutions
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
top salesforce developer skills in 2025.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Adobe Illustrator 28.6 Crack My Vision of Vector Design

Creating Gutenberg Blocks With ACF