2. Extends the post editor allowing easy
collection of different types of data
through specific field types.
Retrieve data from posts and build into
custom WordPress templates using PHP
functions.
@DeveloperWil #wpsyd
4. • Develop sites for clients or yourself
• Working knowledge of HTML, CSS and PHP
• Understand WordPress templating
• Create websites that require flexible & dynamic
data input
@DeveloperWil #wpsyd
5. ACF v4.x is available for free on WordPress.org
https://wordpress.org/plugins/advanced-custom-fields/
@DeveloperWil #wpsyd
6. Basic
– Text
– Text Area
– Number
– Email
– Password
Content
– Wysiwig Editor
– Image
– File
@DeveloperWil #wpsyd
Choice
– Select
– Checkbox
– Radio Button
– True / False
Layout
– Message
– Tab
7. Relational
– Page Link
– Post Object
– Relationship
– Taxonomy
– User
@DeveloperWil #wpsyd
jQuery
– Google Map
– Date Picker
– Color Picker
8. ACF Pro v5.x includes extra fields & features.
https://www.advancedcustomfields.com/pro/
Costs: one-time payment, lifetime updates
AUD $25 for 1 site, AUD $100 for unlimited sites
@DeveloperWil #wpsyd
9. • Repeater Field
Create a set of sub fields which can be repeated again and again whilst editing
content.
• Gallery Field
The gallery field provides a simple and intuitive interface for managing a
collection of images.
• Flexible Content Field
The flexible content field is a complete content layout manager!
• Clone Field
Allows you to select and display existing fields.
@DeveloperWil #wpsyd
10. • Options Pages
Provides a set of functions to add extra admin pages.
• URL
Validates proper http:// https:// URIs
• Range
Number range.
• oEmbed
Embed videos, images, tweets, audio, and other content.
@DeveloperWil #wpsyd
11. • Link
Provides a simple way to select or define a link (url, title, target)
• Date Time Picker
Creates a jQuery date & time selection popup
• Time Picker
Creates a jQuery time selection popup.
• Group
Create a group of fields for consistent layout.
@DeveloperWil #wpsyd
12. ACF uses field groups to attach fields to posts.
Each field group contains a title, fields, location
rules and visual settings.
@DeveloperWil #wpsyd
17. Documentation:
https://www.advancedcustomfields.com/resources
All field data saved as native post_meta. You can
use get_post_meta() however best practice to use
get_field() or the_field().
Why? Because ACF will format the value
depending on the field type and make
development quicker and easier!
@DeveloperWil #wpsyd
19. @DeveloperWil #wpsyd
Display a field
Retrieve a field as a variable
Using conditional statements
get_field returns false if (value == “” || value == null || value == false)
<p><?php the_field('field_name'); ?></p>
<?php
$variable = get_field('field_name’);
// do something with $variable
?>
<?php
if(get_field('field_name')){
echo '<p>' . get_field('field_name') . '</p>’;
}
?>
20. @DeveloperWil #wpsyd
The repeater field
repeater can be accessed by get_field or the_repeater_field / the_sub_field
<?php
if( have_rows('repeater_field_name') ): ?>
<ul>
<?php while( have_rows('repeater_field_name') ): the_row(); ?>
<li>sub_field_1 = <?php the_sub_field('sub_field_1'); ?></li>
<li>sub_field_2 = <?php the_sub_field('sub_field_2'); ?></li>
<?php
$sub_field_3 = get_sub_field('sub_field_3’);
// do something with $sub_field_3
?>
<?php endwhile; ?>
</ul>
<?php endif; ?>
21. @DeveloperWil #wpsyd
ACF can be extended and used alongside the WP
API.
• Actions & Filters
• Add-ons
• Creating new field types
• ACF to WP-API plugin
• Local JSON
• Synchronized JSON
22. @DeveloperWil #wpsyd
• ACF Documentation
• WordPress Melbourne User Group May 2013
Developer Meetup - Elliot Condon & Anthony
Cole
• Using Advanced Custom Fields within a
WordPress Custom Theme
• Jared Novack: Advanced Advanced
Custom Fields