Closed desrosj closed 7 years ago
When a $version_id
is not supplied as a query argument, it is turning into 0 after being type casted as an integer. This is causing some issues with wp_get_post_autosave()
, which is returning a somewhat random revision (I believe it is either a revision for the latest post retrieved, or the latest revision overall).
This fix looks good to me.
Note: Other sites with the BU Versions plugin are properly adding in the version_id to make this work. For some reason, the Abroad site is not making it happen. Hence, it just picks up a random (BU Slideshow) revision from the DB. It's worth investigating why this happens in the future.
@inderpreet99 I will leave #26 open as an issue after we merge this to continue investigating.
This change is fixing the issue for me on NM. I would love some input from someone who knows this plugin more intimately to confirm this won't cause any issues.
Related issue: #26.