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.