I’m not sure what sequence of events caused this issue but it was resolved by deleting a template file and adding it back again. No changes were made the file.
I determined it is some sort of theme error. I disabled the theme and ACF works fine. I am getting this error message when I attempt to add a new field:
Uncaught TypeError: Cannot read property 'outerHTML' of undefinedinput.min.js:1 $.fn.outerHTMLfield-group.min.js:1 acf.field_group.update_field_metafield-group.min.js:1 acf.field_group.wipe_fieldfield-group.min.js:1 acf.field_group.add_fieldfield-group.min.js:1 (anonymous function)jquery.min.js:3 m.event.dispatchjquery.min.js:3 r.handle
Also, I have the same theme running locally and ACF still works there. Has anyone ever seen something like this? Have any debugging tips?
Actually, WordPress has a function wp_strip_all_tags which would work as well. I wrapped it in a function below to work with sub fields.
function jw_strip_all_tags_from_sub_field( $field )
{
$field = get_sub_field( $field );
$field_stripped = wp_strip_all_tags( $field );
return $field_stripped;
}
Had the same issue. I used Strip Tags
strip_tags( get_sub_field( 'field_name' ) );