Challenge - 5 Problems
ACF Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ component_behavior
intermediate2:00remaining
What is the output of this ACF field retrieval code?
Given a custom field named
subtitle added via Advanced Custom Fields to a post, what will this code output inside the Loop?echo get_field('subtitle');Wordpress
<?php
// Inside the WordPress Loop
echo get_field('subtitle');
?>Attempts:
2 left
💡 Hint
Remember that get_field() inside the Loop automatically uses the current post ID.
✗ Incorrect
get_field('subtitle') fetches the value of the custom field named 'subtitle' for the current post when used inside the Loop.
📝 Syntax
intermediate2:00remaining
Which option correctly registers a new ACF field group with PHP?
You want to register a new ACF field group programmatically using PHP. Which code snippet is correct?
Attempts:
2 left
💡 Hint
Look for the official ACF function to add local field groups.
✗ Incorrect
acf_add_local_field_group() is the correct function to register field groups in PHP with the proper array structure.
❓ state_output
advanced2:00remaining
What is the value of $image_url after this ACF image field retrieval?
Assuming an ACF image field named
header_image returns an array, what will be the value of $image_url after this code?$image = get_field('header_image');
$image_url = $image['url'];Wordpress
<?php $image = get_field('header_image'); $image_url = $image['url']; ?>
Attempts:
2 left
💡 Hint
When an image field returns an array, it includes keys like 'url', 'alt', and 'sizes'.
✗ Incorrect
If the image field is set to return an array, $image['url'] contains the image URL string.
🔧 Debug
advanced2:00remaining
Why does this ACF repeater field loop not output any rows?
This code is intended to loop through a repeater field named
features but outputs nothing. Why?if( have_rows('features') ) {
while( have_rows('features') ) {
the_row();
echo get_sub_field('feature_name');
}
}Wordpress
<?php if( have_rows('features') ) { while( have_rows('features') ) { the_row(); echo get_sub_field('feature_name'); } } ?>
Attempts:
2 left
💡 Hint
Check if the repeater field has data for the current post.
✗ Incorrect
If the repeater field is empty or not assigned to the current post, have_rows() returns false and the loop does not run.
🧠 Conceptual
expert2:00remaining
Which option best describes how ACF stores custom field data in the WordPress database?
Advanced Custom Fields stores custom field data in the WordPress database. How does it store this data?
Attempts:
2 left
💡 Hint
Think about how WordPress normally stores custom fields.
✗ Incorrect
ACF uses the standard WordPress postmeta table, storing each field value as a separate meta_key/meta_value pair.