In advanced WordPress sites, we need to use custom code and create custom functionality. We can build new features from scratch or extend the built-in features using custom code. We use many third-party plugins in a normal WordPress site. It's not recommended to edit the code of third-party plugins as you will lose the changes in version upgrades. Due to this, we need a way of adding custom code without losing the code in version upgrades.
In Chapter 2, Customizing Theme Design and Layout, we created a child theme to avoid making changes in the core theme files. We need a similar solution for plugins. In this recipe, we are going to look at the process of adding custom code by using a custom plugin.