SlideShare a Scribd company logo
1 of 34
Download to read offline
bit.ly/wpsydacf
@leocaseiro
ACF
ADVANCED CUSTOM FIELDS FOR WP - 101
http://bit.ly/wpsydacf
By /Leo Caseiro @leocaseiro
WHO AM I
Brazilian - Web Developer at - -IDM Renet IPMG
Translator: /WordPress PT-BR Tuts+
Community: /BR WP Forum WordPress Stackoverflow
WordPress Plugin Developer
WHY WP IS AWESOME?
NATIVE WP CUSTOM FIELDS
NATIVE WP CUSTOM FIELDS = MESS
ADVANCED CUSTOM FIELDS
ACF: TYPES OF FIELDS 4.4.2 (FREE)
ACF: FEATURES - VALIDATION
ACF: FEATURES - CONDITIONAL LOGIC
ACF: FEATURES - PREFIX - SUFIX - PLACEHOLDER
ACF: RELATIONAL
ACF: JQUERY - GMAPS, DATE PICKER, COLOR PICKER
ACF: NEED MORE? (EXTENSIONS)
ACF: STEP BY STEP - MOVIE DATABASE SITE
ACF: STEP BY STEP - MOVIE DB - TAB DETAILS
ACF: STEP BY STEP - CLASSIFICATION
ACF: STEP BY STEP - PREFIX, SUFIX AND PLACEHOLDER
ACF: STEP BY STEP - RELATIONAL
ACF: STEP BY STEP - CONDITIONAL LOGIC
ACF: STEP BY STEP - COUNTRY ACTOR + MOVIE
FRONTEND - DEMO https://github.com/leocaseiro/acf-movie-demo
SHOW ME SOME CODE
<p><?php the_field('country'); ?></p>
<?php $subtitle = get_field('country'); echo $subtitle; ?>
<?php
//get_post_meta() works, better to use the_field() and get_field()
echo get_post_meta( get_the_ID(), 'country', true );
?>
ACF documentation
FRONTEND - FROM DATEPICKER TO DATE I18N
<?php
$release_date = get_field( 'release_date' ); //Format: yyyymmdd
echo date_i18n( 'l, F j, Y', strtotime( $release_date ) );
?>
https://codex.wordpress.org/Function_Reference/date_i18n
FRONTEND - CONDITIONAL LOGIC
<?php if ( get_field( 'has_video' ) ) : ?>
<h3>Trailer</h3>
<?php the_field('trailer'); //oEmbed ?>
<hr>
<?php endif; ?>
http://www.advancedcustomfields.com/resources/code-examples/#using-conditional statements
FRONTEND - RELATIONAL PARENT (MOVIE)
<ul>
<?php $cast = get_field('cast');
foreach( $cast as $post): // var must be called $post (IMPORTANT)
setup_postdata( $post ); ?>
<li>
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
<?php the_post_thumbnail(); ?>
</a>
</li>
<?php wp_reset_postdata(); // IMPORTANT - reset the $post object
// so the rest of the page works correctly
endforeach;
?>
</ul>
http://www.advancedcustomfields.com/resources/code-examples/#using-conditional statements
FRONTEND - RELATIONAL CHILD (ACTOR)
get_posts()
<?php
$movies = get_posts( array(
'post_type' => 'movie',
'meta_query' => array(
array(
'key' => 'cast', // Field Name (ACF)
'value' => '"' . get_the_ID() . '"', //Leave ""
'compare' => 'LIKE'
)
)
));
?>
http://www.advancedcustomfields.com/resources/tutorials/querying-relationship-fields/
FRONTEND - RELATIONAL CHILD (ACTOR)
Show parents related
<ul>
<?php $movies = get_posts(...); //See Previous Slide
foreach( $movies as $post): // var must be called $post (IMPORTANT)
setup_postdata( $post ); ?>
<li>
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
<?php the_post_thumbnail(); ?>
</a>
</li>
<?php wp_reset_postdata(); // IMPORTANT - reset the $post object
// so the rest of the page works correctly
endforeach;
?>
</ul>
http://www.advancedcustomfields.com/resources/tutorials/querying-relationship-fields/
WHY ACF?
Doesn't create MySQL table
User Interface
900,000+
WP Way
Documentation
Support
similar Plugins at http://comparewp.org/
GO ACF PRO V5
ACF PRO - EXTRAS
Local JSON
Fields in Comments, Widget, Users
Validation PHP + AJAX
acf_form()
BEYOND THIS TALK
WordPress Plugins: Advanced Custom Fields
Jared Novack: Advanced Advanced Custom Fields
Using Advanced Custom Fields within a WordPress Custom Theme
Elliot Condon talks - WP Melbourne:
Story of Advanced Custom Field - May 2013
ACF 5 Walk-through - May 2014
ADVANCED USE
Actions and Filters
Creating a new field type
Extensions
ACF to WP-API Plugin
Local JSON
Syncronized JSON
http://www.advancedcustomfields.com/resources/
QUESTIONS?
CHEERS MATE!
By /Leo Caseiro @leocaseiro

More Related Content

What's hot (11)

Alfresco global.properties
Alfresco global.propertiesAlfresco global.properties
Alfresco global.properties
 
Php Basic Security
Php Basic SecurityPhp Basic Security
Php Basic Security
 
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
 
Refactoring PHP/Symfony2 apps
Refactoring PHP/Symfony2 appsRefactoring PHP/Symfony2 apps
Refactoring PHP/Symfony2 apps
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Session1+2
Session1+2Session1+2
Session1+2
 
Seasion5
Seasion5Seasion5
Seasion5
 
My Story With Flickr
My Story With FlickrMy Story With Flickr
My Story With Flickr
 
JSON and the APInauts
JSON and the APInautsJSON and the APInauts
JSON and the APInauts
 
Outside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and RspecOutside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and Rspec
 
Session3
Session3Session3
Session3
 

Viewers also liked

How To Embed SlideShare Shows Into WordPress.com
How To Embed SlideShare Shows Into WordPress.comHow To Embed SlideShare Shows Into WordPress.com
How To Embed SlideShare Shows Into WordPress.comKathy Gill
 
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)Board of Innovation
 
The Seven Deadly Social Media Sins
The Seven Deadly Social Media SinsThe Seven Deadly Social Media Sins
The Seven Deadly Social Media SinsXPLAIN
 
Five Killer Ways to Design The Same Slide
Five Killer Ways to Design The Same SlideFive Killer Ways to Design The Same Slide
Five Killer Ways to Design The Same SlideCrispy Presentations
 
How People Really Hold and Touch (their Phones)
How People Really Hold and Touch (their Phones)How People Really Hold and Touch (their Phones)
How People Really Hold and Touch (their Phones)Steven Hoober
 
Upworthy: 10 Ways To Win The Internets
Upworthy: 10 Ways To Win The InternetsUpworthy: 10 Ways To Win The Internets
Upworthy: 10 Ways To Win The InternetsUpworthy
 
What 33 Successful Entrepreneurs Learned From Failure
What 33 Successful Entrepreneurs Learned From FailureWhat 33 Successful Entrepreneurs Learned From Failure
What 33 Successful Entrepreneurs Learned From FailureReferralCandy
 
Why Content Marketing Fails
Why Content Marketing FailsWhy Content Marketing Fails
Why Content Marketing FailsRand Fishkin
 
The History of SEO
The History of SEOThe History of SEO
The History of SEOHubSpot
 
How To (Really) Get Into Marketing
How To (Really) Get Into MarketingHow To (Really) Get Into Marketing
How To (Really) Get Into MarketingEd Fry
 
The What If Technique presented by Motivate Design
The What If Technique presented by Motivate DesignThe What If Technique presented by Motivate Design
The What If Technique presented by Motivate DesignMotivate Design
 
10 Powerful Body Language Tips for your next Presentation
10 Powerful Body Language Tips for your next Presentation10 Powerful Body Language Tips for your next Presentation
10 Powerful Body Language Tips for your next PresentationSOAP Presentations
 
Crap. The Content Marketing Deluge.
Crap. The Content Marketing Deluge.Crap. The Content Marketing Deluge.
Crap. The Content Marketing Deluge.Velocity Partners
 
What Would Steve Do? 10 Lessons from the World's Most Captivating Presenters
What Would Steve Do? 10 Lessons from the World's Most Captivating PresentersWhat Would Steve Do? 10 Lessons from the World's Most Captivating Presenters
What Would Steve Do? 10 Lessons from the World's Most Captivating PresentersHubSpot
 
Digital Strategy 101
Digital Strategy 101Digital Strategy 101
Digital Strategy 101Bud Caddell
 
The Search for Meaning in B2B Marketing
The Search for Meaning in B2B MarketingThe Search for Meaning in B2B Marketing
The Search for Meaning in B2B MarketingVelocity Partners
 

Viewers also liked (20)

How To Embed SlideShare Shows Into WordPress.com
How To Embed SlideShare Shows Into WordPress.comHow To Embed SlideShare Shows Into WordPress.com
How To Embed SlideShare Shows Into WordPress.com
 
The Minimum Loveable Product
The Minimum Loveable ProductThe Minimum Loveable Product
The Minimum Loveable Product
 
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
 
The Seven Deadly Social Media Sins
The Seven Deadly Social Media SinsThe Seven Deadly Social Media Sins
The Seven Deadly Social Media Sins
 
Five Killer Ways to Design The Same Slide
Five Killer Ways to Design The Same SlideFive Killer Ways to Design The Same Slide
Five Killer Ways to Design The Same Slide
 
How People Really Hold and Touch (their Phones)
How People Really Hold and Touch (their Phones)How People Really Hold and Touch (their Phones)
How People Really Hold and Touch (their Phones)
 
Upworthy: 10 Ways To Win The Internets
Upworthy: 10 Ways To Win The InternetsUpworthy: 10 Ways To Win The Internets
Upworthy: 10 Ways To Win The Internets
 
What 33 Successful Entrepreneurs Learned From Failure
What 33 Successful Entrepreneurs Learned From FailureWhat 33 Successful Entrepreneurs Learned From Failure
What 33 Successful Entrepreneurs Learned From Failure
 
Design Your Career 2018
Design Your Career 2018Design Your Career 2018
Design Your Career 2018
 
Why Content Marketing Fails
Why Content Marketing FailsWhy Content Marketing Fails
Why Content Marketing Fails
 
The History of SEO
The History of SEOThe History of SEO
The History of SEO
 
How To (Really) Get Into Marketing
How To (Really) Get Into MarketingHow To (Really) Get Into Marketing
How To (Really) Get Into Marketing
 
The What If Technique presented by Motivate Design
The What If Technique presented by Motivate DesignThe What If Technique presented by Motivate Design
The What If Technique presented by Motivate Design
 
Displaying Data
Displaying DataDisplaying Data
Displaying Data
 
10 Powerful Body Language Tips for your next Presentation
10 Powerful Body Language Tips for your next Presentation10 Powerful Body Language Tips for your next Presentation
10 Powerful Body Language Tips for your next Presentation
 
Crap. The Content Marketing Deluge.
Crap. The Content Marketing Deluge.Crap. The Content Marketing Deluge.
Crap. The Content Marketing Deluge.
 
What Would Steve Do? 10 Lessons from the World's Most Captivating Presenters
What Would Steve Do? 10 Lessons from the World's Most Captivating PresentersWhat Would Steve Do? 10 Lessons from the World's Most Captivating Presenters
What Would Steve Do? 10 Lessons from the World's Most Captivating Presenters
 
Digital Strategy 101
Digital Strategy 101Digital Strategy 101
Digital Strategy 101
 
How Google Works
How Google WorksHow Google Works
How Google Works
 
The Search for Meaning in B2B Marketing
The Search for Meaning in B2B MarketingThe Search for Meaning in B2B Marketing
The Search for Meaning in B2B Marketing
 

Similar to WordPress Advanced Custom Fields - 101

Custom post-framworks
Custom post-framworksCustom post-framworks
Custom post-framworkswcto2017
 
Using WordPress as your application stack
Using WordPress as your application stackUsing WordPress as your application stack
Using WordPress as your application stackPaul Bearne
 
November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2Kacper Gunia
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumJeroen van Dijk
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressJeroen van Dijk
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers StealBen Scofield
 
WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hackingJeroen van Dijk
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)LumoSpark
 
WIRED and the WP REST API
WIRED and the WP REST APIWIRED and the WP REST API
WIRED and the WP REST APIkvignos
 
Apostrophe (improved Paris edition)
Apostrophe (improved Paris edition)Apostrophe (improved Paris edition)
Apostrophe (improved Paris edition)tompunk
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressJeroen van Dijk
 
August 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle TwitterAugust 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle TwitterStraight North
 
FVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / WidgetsFVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / WidgetsPete DuMelle
 
Spyware/Malware FVCP
Spyware/Malware  FVCPSpyware/Malware  FVCP
Spyware/Malware FVCPPete DuMelle
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Michael Wales
 
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Jacopo Romei
 
Laying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme developmentLaying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme developmentTammy Hart
 

Similar to WordPress Advanced Custom Fields - 101 (20)

Custom post-framworks
Custom post-framworksCustom post-framworks
Custom post-framworks
 
Using WordPress as your application stack
Using WordPress as your application stackUsing WordPress as your application stack
Using WordPress as your application stack
 
November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in Titanium
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
 
WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hacking
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
 
WIRED and the WP REST API
WIRED and the WP REST APIWIRED and the WP REST API
WIRED and the WP REST API
 
Blog Hacks 2011
Blog Hacks 2011Blog Hacks 2011
Blog Hacks 2011
 
Apostrophe (improved Paris edition)
Apostrophe (improved Paris edition)Apostrophe (improved Paris edition)
Apostrophe (improved Paris edition)
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
August 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle TwitterAugust 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle Twitter
 
FVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / WidgetsFVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / Widgets
 
Spyware/Malware FVCP
Spyware/Malware  FVCPSpyware/Malware  FVCP
Spyware/Malware FVCP
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
 
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011
 
Laying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme developmentLaying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme development
 

Recently uploaded

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

WordPress Advanced Custom Fields - 101

  • 1. bit.ly/wpsydacf @leocaseiro ACF ADVANCED CUSTOM FIELDS FOR WP - 101 http://bit.ly/wpsydacf By /Leo Caseiro @leocaseiro
  • 2. WHO AM I Brazilian - Web Developer at - -IDM Renet IPMG Translator: /WordPress PT-BR Tuts+ Community: /BR WP Forum WordPress Stackoverflow WordPress Plugin Developer
  • 3. WHY WP IS AWESOME?
  • 5. NATIVE WP CUSTOM FIELDS = MESS
  • 7. ACF: TYPES OF FIELDS 4.4.2 (FREE)
  • 8. ACF: FEATURES - VALIDATION
  • 9. ACF: FEATURES - CONDITIONAL LOGIC
  • 10. ACF: FEATURES - PREFIX - SUFIX - PLACEHOLDER
  • 12. ACF: JQUERY - GMAPS, DATE PICKER, COLOR PICKER
  • 13. ACF: NEED MORE? (EXTENSIONS)
  • 14. ACF: STEP BY STEP - MOVIE DATABASE SITE
  • 15. ACF: STEP BY STEP - MOVIE DB - TAB DETAILS
  • 16. ACF: STEP BY STEP - CLASSIFICATION
  • 17. ACF: STEP BY STEP - PREFIX, SUFIX AND PLACEHOLDER
  • 18. ACF: STEP BY STEP - RELATIONAL
  • 19. ACF: STEP BY STEP - CONDITIONAL LOGIC
  • 20. ACF: STEP BY STEP - COUNTRY ACTOR + MOVIE
  • 21. FRONTEND - DEMO https://github.com/leocaseiro/acf-movie-demo
  • 22. SHOW ME SOME CODE <p><?php the_field('country'); ?></p> <?php $subtitle = get_field('country'); echo $subtitle; ?> <?php //get_post_meta() works, better to use the_field() and get_field() echo get_post_meta( get_the_ID(), 'country', true ); ?> ACF documentation
  • 23. FRONTEND - FROM DATEPICKER TO DATE I18N <?php $release_date = get_field( 'release_date' ); //Format: yyyymmdd echo date_i18n( 'l, F j, Y', strtotime( $release_date ) ); ?> https://codex.wordpress.org/Function_Reference/date_i18n
  • 24. FRONTEND - CONDITIONAL LOGIC <?php if ( get_field( 'has_video' ) ) : ?> <h3>Trailer</h3> <?php the_field('trailer'); //oEmbed ?> <hr> <?php endif; ?> http://www.advancedcustomfields.com/resources/code-examples/#using-conditional statements
  • 25. FRONTEND - RELATIONAL PARENT (MOVIE) <ul> <?php $cast = get_field('cast'); foreach( $cast as $post): // var must be called $post (IMPORTANT) setup_postdata( $post ); ?> <li> <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> <?php the_post_thumbnail(); ?> </a> </li> <?php wp_reset_postdata(); // IMPORTANT - reset the $post object // so the rest of the page works correctly endforeach; ?> </ul> http://www.advancedcustomfields.com/resources/code-examples/#using-conditional statements
  • 26. FRONTEND - RELATIONAL CHILD (ACTOR) get_posts() <?php $movies = get_posts( array( 'post_type' => 'movie', 'meta_query' => array( array( 'key' => 'cast', // Field Name (ACF) 'value' => '"' . get_the_ID() . '"', //Leave "" 'compare' => 'LIKE' ) ) )); ?> http://www.advancedcustomfields.com/resources/tutorials/querying-relationship-fields/
  • 27. FRONTEND - RELATIONAL CHILD (ACTOR) Show parents related <ul> <?php $movies = get_posts(...); //See Previous Slide foreach( $movies as $post): // var must be called $post (IMPORTANT) setup_postdata( $post ); ?> <li> <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> <?php the_post_thumbnail(); ?> </a> </li> <?php wp_reset_postdata(); // IMPORTANT - reset the $post object // so the rest of the page works correctly endforeach; ?> </ul> http://www.advancedcustomfields.com/resources/tutorials/querying-relationship-fields/
  • 28. WHY ACF? Doesn't create MySQL table User Interface 900,000+ WP Way Documentation Support similar Plugins at http://comparewp.org/
  • 30. ACF PRO - EXTRAS Local JSON Fields in Comments, Widget, Users Validation PHP + AJAX acf_form()
  • 31. BEYOND THIS TALK WordPress Plugins: Advanced Custom Fields Jared Novack: Advanced Advanced Custom Fields Using Advanced Custom Fields within a WordPress Custom Theme Elliot Condon talks - WP Melbourne: Story of Advanced Custom Field - May 2013 ACF 5 Walk-through - May 2014
  • 32. ADVANCED USE Actions and Filters Creating a new field type Extensions ACF to WP-API Plugin Local JSON Syncronized JSON http://www.advancedcustomfields.com/resources/
  • 34. CHEERS MATE! By /Leo Caseiro @leocaseiro