add global to code snippet to make it easier to copy and paste
Created by: kcristiano
Refrence https://github.com/civicrm/civicrm-core/pull/18068 In testing I left out declaring the global as I copy/pasted from the docs. Let's add the global in to make it clear that it is needed.