Home Forums ACF PRO ACF Field Data Disappears Reply To: ACF Field Data Disappears

  • An explanation of why preview does not work with ACF fields.

    WP does not go through the same process when you click on preview. None of the custom fields are submitted. This causes WP to store a draft of just the stuff that is native to WP. This works the same way as WP Auto Save. In fact, clicking on preview actually calls WP Autosave. WP is temporarily storing a draft of the content and those things that are native to WP and it is ignoring all the custom fields.

    This is the case no matter what the status of the post is. If you edit the ACF fields for a published post and click on preview before updating the post you will see the previous values of the ACF fields will be shown and not the current values.

    The only reason that I can see that the content of ACF fields would be missing completely is if the previous save of the post had no content in those fields. So, they scheduled a post before entering content there and then they entered data and then clicked on preview before clicking on update or never clicked update. And from what you’re telling me basically when using guberbug is that the default is to not open the preview in a new window so it makes perfect sense to me why the content would disappear, because the content was never saved. I did not know this, I do not create sites that use the “New Editor”. It is a poor assumption on the part of the WP/guberbug developers to assume that users are only going to use that editor for all content.

    In any case the “Preview” feature in WP is completely worthless when using custom fields and this is the case with ACF, native WP custom fields, or any other plugin that creates custom fields. This has always been the case. A post must always be saved before clicking preview to see updated custom field content, whether it is opened in a new window or not.

    I don’t see how ACF can hope to fix this unless they replace the WP autosave with something that does not completely ignore everything that is not native to WP or perhaps a second script that is run when preview is clicked that does the same thing that is done by autosave but for ACF fields.