Thanks John,
But as the other fellas pointed out, this would be useful information on the acf_form doc page.
Aha, I now realise that the whole messed is based on my use of select fields and not text fields with the wp_kses_post() function.
Many have had this issue to fight with it looks like.
http://support.advancedcustomfields.com/forums/topic/acf_form-security-documentation/
I will now try to use your function:
function acf_wp_kses_post($data) {
if (!is_array($data)) {
return wp_kses_post($data);
}
$return = array();
foreach ($data as $index => $value) {
$return[$index] = acf_wp_kses_post($value);
}
return $return;
}
Im in exactly same boat as kisabelle. But nice to finely have to clearance on this – Thanks David.
OPDATE.
It seems there is an issue between your acf_form and the wp_kses_post() sanitize function.
I just tried the same setup on another wp installation where i was able to do some more debugging and found a header conflict.
So i tried removing the sanitization function and then my select fields update fine.
Oops, by the way, its two select fields i have in the repeater, not text fields.
How could i get an indication whether my field is attached to the right post type?
My acf_form looks like this:
<?php
add_filter('acf/update_value', 'wp_kses_post', 10, 1);
acf_form_head();
get_header(); ?>
acf_form(array(
'post_id' => 'new_post',
'submit_value' => __("Submit", 'acf'),
'post_title' => true,
'field_groups' => array(74, 1019),
'new_post' => array(
'post_type' => 'events',
'post_status' => 'pending'
),
'tax_input' => array( 'photo_category' => array( date('Y') ) ),
'uploader' => 'basic'
));
Also im using this filter for a custom title label:
add_filter( 'acf/get_valid_field', 'change_input_labels');
function change_input_labels($field) {
if($field['name'] == '_post_title') {
$field['label'] = 'Name';
}
return $field;
}
Ive tried changing it a few times in the past, thought the same thing.
Its called ‘event_times’.
The 2 text fields are called ‘event_from_time’ and ‘event_to_time’ – which seems legit enough?
Yes I’ve tried disabling the filter.
Its my own theme that Im developing and I’ve tried disabling major functions and actions + deactivating all plugins..
Cant see anything suspicious in the database.
Any other ideas on how I could narrow down the issue?
Best regards.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.