For some reason, although I have the latest version installed, that file didn’t update. Perhaps because I used WordPress’s update option it somehow skipped updating that one… ah well. All sorted now.
The code snippet worked a treat with a little extra tweaking. Thank you!