0

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.

3
  • 2
    If you're running a multisite and need an upgrade safe way then wrapping those custom functionality into a plugin would be a better choice.
    – obiPlabon
    Commented Feb 23, 2018 at 18:52
  • @obiPlabon that's what I thought. If you make that an answer I will accept Commented Feb 23, 2018 at 19:49
  • That's great! Added the comment as an answer. Thanks :)
    – obiPlabon
    Commented Feb 24, 2018 at 5:29

1 Answer 1

2

If you're running a multisite and need an upgrade safe way then wrapping those custom functionality into a plugin would be a better choice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.