The episode is covered in this extract from Yeah Yeah Yeah: The Beatles & Bournemouth...
On 12 March Paul McCartney married Linda Eastman in London and just two days later, John (who had divorced Cynthia the previous August) announced he was to marry Yoko Ono. On a visit to Aunt Mimi at Sandbanks John sent his chauffeur, Les Anthony, to Southampton to find out if he and Yoko could marry at sea. Having been told that would not be possible they chartered a private jet to take them to Paris, but were unable to arrange a wedding at short notice so opted to “get married in Gibraltar near Spain”, as related in The Beatles’ final number one single, The Ballad Of John and Yoko.
The song also represented something like the spirit of The Beatles of old. Although mainly written by John, it was finished by Lennon and McCartney at Paul’s home on 14 April and recorded the same evening with the two playing all the instruments as George was on holiday and Ringo was away filming The Magic Christian. Buoyed by this new spirit The Beatles regrouped, went back to basics and made Abbey Road. It was released on 26 September, returning the group to the top of the charts on both sides of the Atlantic.
For a finely detailed account of the song's genesis, recording and release - as well as a raw version of the finished track without overdubs - take a look at the redoubtable Beatles Rarity website post.
Signed copies of Yeah Yeah Yeah: The Beatles & Bournemouth and limited edition prints of previously unpublished photos from the book can be ordered here.