bu-versions icon indicating copy to clipboard operation
bu-versions copied to clipboard

When previewing any post, attached images lose their captions

Open jonjennings opened this issue 8 years ago • 2 comments

Many thanks for your plugin - it adds something that I think really should be fundamental to any multi-user workflow. However there's one small issue that's caused us some problems.

The plugin adds a hook on the_preview which calls BU_Version_Controller->preview()

This function is copying data from another post down over the content in the post being previewed - presumably to allow previewing how an alt version would look?

One side-effect of the way it currently works is that an attachment (eg a featured image) gets its excerpt overwritten by the excerpt of the post to which it's attached because this function gets called on the attachment's post ID.

As a result, images on our page previews lose their captions (because WP stores the caption of an image in its excerpt).

I'm afraid to propose changes to preview() and redirect_preview() because I don't understand how they fit into the existing functionality of the plugin, but could you find a way to make things a little more selective - so you don't disturb data on attachments, only the posts themselves?

As it is, we've had to disable that hook - which presumably has other issues.

jonjennings avatar Jul 06 '16 21:07 jonjennings