1 Jul

ACF PRO 5.6.0 Beta2

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.

Improvements

  • Added new generic input helper functions acf_text_input(), acf_textarea_input() and acf_select_input()
  • Added new initialize() function to the ‘acf_field’ class to allow inheritance
  • Improved have_rows() function to work with Clone field and Group field values!

Bug fixes

  • Fixed JS scroll lag in Gallery field media popup
  • Fixed JS error when changing ‘post_template’ value
  • Fixed PHP error in acf_add_options_sub_page() function
  • Fixed JS ‘focus on active editor’ bug after selecting a link (link field)

have_rows()

This 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; ?>