ACF PRO 5.6.0 Beta2 is available for testing. This includes all the new awesome features shown in the ACF PRO 5.6.0 Beta1 and ACF PRO 5.6.0 – UI, UX & You announcements.
To test ACF PRO 5.6.0-beta2, please login to your store account and click the See all versions link alongside your license. Download, extract and replace ‘advanced-custom-fields-pro’ plugin folder contents.
Think you’ve found a bug? Please post in detail a new support ticket.
acf_text_input()
, acf_textarea_input()
and acf_select_input()
initialize()
function to the ‘acf_field’ class to allow inheritancehave_rows()
function to work with Clone field and Group field values!acf_add_options_sub_page()
functionThis version introduces some improvements to the have_rows() function. This function can now be used to ‘loop’ through a Clone field or Group field’s values! This is similar to looping over a Repeater field value, however, there is only a single row in this value.
This improvement allows easier access to a sub field values as the have_rows()
function can be nested. Here is an example (taken from the Group field documentation) demonstrating how to loop over a Group field called ‘Hero’.
<?php if( have_rows('hero') ):
while( have_rows('hero') ): the_row();
// vars
$image = get_sub_field('image');
$link = get_sub_field('link');
?>
<div id="hero">
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<div class="content">
<?php the_sub_field('caption'); ?>
<a href="<?php echo $link['url']; ?>"><?php echo $link['title']; ?></a>
</div>
</div>
<style type="text/css">
#hero {
background: <?php the_sub_field('color'); ?>;
}
</style>
<?php endwhile; ?>
<?php endif; ?>