In reply to Jeff Chandler.

I never edit core. I use site plugins, generally in the wp-content/mu-plugins directory, so that they cannot be deactivated (and I don't even have to activate them - I'm lazy like that). They are independent of the theme. You can add some comments at the top of the file to describe the code: http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/