The update to 0.9.0.8 broke the dynamic render function.

[ad_1]

Hello,

Thanks for the feedback and the detailed report!

In fact, the latest 0.9.0.8 version added some changes in order to make the get_row_index() work with the Flexible Content Dynamic Render in the admin preview.

After some extensive checks, it looks like these changes broke the usage of get_row() and get_row_layout() in the admin preview.

If you’re using these functions in Flexible Content hooks you might run into problems. For example if you change the Layout Template Path programmatically with acfe/flexible/render/template (see documentation) and check get_row() or get_row_layout().

Here is a quick fix you can add to your theme’s functions.php file in order to fix this issue globally.

// ACFE 0.9.0.8: Fix get_row() & get_row_layout() usage in Flexible Content preview
add_filter('acfe/flexible/render/template', 'acfe_fix_flexible_content_preview_get_row', 0, 4);
function acfe_fix_flexible_content_preview_get_row($file, $field, $layout, $is_preview){

if($is_preview){
acf_update_loop('active', 'i', 0);
}

// return
return $file;

}

Note this will revert the changes of the 0.9.0.8 update, and make get_row_index() always return 1 in the WP Admin (just like in the previous version).

I’m preparing an update which will fix both functions usage.

Thanks again for the report, and sorry for the inconvenience.

Regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer