Support

Account

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;
    	}