The directory includes/functions/extra_functions exists so you can add custom functions like the one you're describing. Use the function I pointed you to as a model for your new function.