Hello,
Thanks for the feedback! The acfe/flexible/preview
hook has been deprecated since 0.8.6.7 version for code consistency purpose. If you want to do an action right before the Layout Template File is rendered, you should now use the acfe/flexible/render/before_template
hook.
Here are the available hooks variations:
do_action("acfe/flexible/render/before_template", $field, $layout, $is_preview);
do_action("acfe/flexible/render/before_template/name=my_flexible", $field, $layout, $is_preview);
do_action("acfe/flexible/render/before_template/key=field_abc123", $field, $layout, $is_preview);
do_action("acfe/flexible/render/before_template/layout=my_layout", $field, $layout, $is_preview);
do_action("acfe/flexible/render/before_template/name=my_flexible&layout=my_layout", $field, $layout, $is_preview);
do_action("acfe/flexible/render/before_template/key=field_abc123&layout=my_layout", $field, $layout, $is_preview);
You can also do an action after the Template File render with the acfe/flexible/render/after_template
hook.
Same logic, here are the available hooks variations:
do_action("acfe/flexible/render/after_template", $field, $layout, $is_preview);
do_action("acfe/flexible/render/after_template/name=my_flexible", $field, $layout, $is_preview);
do_action("acfe/flexible/render/after_template/key=field_abc123", $field, $layout, $is_preview);
do_action("acfe/flexible/render/after_template/layout=my_layout", $field, $layout, $is_preview);
do_action("acfe/flexible/render/after_template/name=my_flexible&layout=my_layout", $field, $layout, $is_preview);
do_action("acfe/flexible/render/after_template/key=field_abc123&layout=my_layout", $field, $layout, $is_preview);
If you simply don’t want to render a specific Layout Template File programmatically, you can use the acfe/flexible/render/template
filter and return false
(this hook is used between before_template
& after_template
hooks).
Here are the hooks variations:
apply_filters("acfe/flexible/render/template", $file, $field, $layout, $is_preview);
apply_filters("acfe/flexible/render/template/name=my_flexible", $file, $field, $layout, $is_preview);
apply_filters("acfe/flexible/render/template/key=field_abc123", $file, $field, $layout, $is_preview);
apply_filters("acfe/flexible/render/template/layout=my_layout", $file, $field, $layout, $is_preview);
apply_filters("acfe/flexible/render/template/name=my_flexible&layout=my_layout", $file, $field, $layout, $is_preview);
apply_filters("acfe/flexible/render/template/key=field_abc123&layout=my_layout", $file, $field, $layout, $is_preview);
Hope it helps!
Regards.