We've got a few customizations to the standard WP installation, specifically a custom post type, some custom fields implemented using CMB2, and some hooks to admin menu configuration using the admin_menu
, admin_bar_menu
, and wp_dashboard_setup
events. We also hook the init
event for the custom post and fields. We have the event hooks defined in a custom php file that is required at the end of functions.php.
This is all working well, but my concern is that this arrangement does require a slight modification to functions.php, which is part of the WordPress source. Won't this be a problem when we need to upgrade (since functions.php will be replaced in a upgrade, right?) Is there a better way to plug our code into the WP initialization sequence that won't be disabled by simple upgrades?
We want these customizations to be independent of templates, but we could move this to a plugin if that would work. We're running a network and we want the customizations to be consistent for all sites in the network, regardless of what template they're using.