Home › Forums › Backend Issues (wp-admin) › Custom fields get emptied when publishing › Reply To: Custom fields get emptied when publishing
I believe I have the latest. acf.php:save_post() looks like this:
function save_post( $post_id )
{
// load from post
if( !isset($_POST['fields']) )
{
return false;
}
// loop through and save
if( !empty($_POST['fields']) )
{
// loop through and save $_POST data
foreach( $_POST['fields'] as $k => $v )
{
// get field
$f = apply_filters('acf/load_field', false, $k );
// update field
do_action('acf/update_value', $v, $post_id, $f );
}
// foreach($fields as $key => $value)
}
// if($fields)
return true;
}
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.