Support

Account

Home Forums ACF PRO Values cannot be saved no matter what I do Reply To: Values cannot be saved no matter what I do

  • ok – update. for me, this ticket on another plugin helped me :

    I had recently added some code to that particular theme because (long story) this is a multisite, and in multisites there are restrictions that prevent non super-admins from adding iframes or embeds so I created a field for code with ACF that I run through this filter:

    // remove the html filter on all ACF fields
    add_filter('acf/allow_unfiltered_html', 'mfo_acf_allow_unfiltered_html_all_fields');
    function mfo_acf_allow_unfiltered_html_all_fields() {
        return true;
    }
    // re-apply filter to non-code fields
    add_filter('acf/update_value', 'mfo_acf_disallow_unfiltered_html_non_code_field', 1, 3);
    function mfo_acf_disallow_unfiltered_html_non_code_field($value, $post_id, $field){
            if(
                $field['type'] !== 'acf_code_field'){
                $value = wp_kses_post($value);
    		}
    
        return $value;
    }
    

    this is what breaks the ACF relationship add…

    the function wp_kses_post mentioned in the link above put me on the right track. so now, I need to find a way to add that filter without breaking ACF… any suggestions? I can open a different thread if you prefer.