Child plugin flow?

I have a child theme working quite nicely. I want to do the same with several plugins, modify their functionality so that upgrades don’t effect the changes. Is there an example/article on the best way to do it?


Great question! I don’t know of any official way and I’m sorry I have to make a quick reply right now with some suggestions:

  • obviously you can override any templates defined in the plugin, though you are asking about functionality;
  • there may be hooks you can use. For example, the form plugin has a few, and you can use these to, for example, define custom form actions;
  • I’ve done this but don’t have time to look it up: in your “child” plugin, extend the class defined in the plugin’s PHP file and add methods, as you would extend or customise any other PHP class;
  • add Twig filters or functions using PHP that are defined in the “parent” plugin;
  • make a fork of the plugin’s repo, clone that, and hack it as you like. You can modify the plugin’s blueprint to make sure it fetches your fork rather than the one in the GPM repo. I do this fairly often, especially after submitting patches to the original plugin repos that don’t get actioned (often stagnant or abandoned plugins).

Sorry that’s a bit quick. Hope it helps.

1 Like