If you develop with Give you most likely use some of our actions and/or filters. Give 1.7 is deprecating some actions, filters, and functions that reference “products” or “purchases.” Here’s what that means for you and what to do about it.
You might be aware that when we created Give, we used a lot of the internal logic of the popular eCommerce plugin, Easy Digital Downloads (aka EDD). EDD is about digital products and has a conventional cart and checkout process and is all about “products” and “purchases.” At the time it was convenient to maintain that nomenclature rather than deviate. But now that the differences between the Give code-base and EDD’s are substantial we want our developers to be immersed in all things “donations” rather than “purchases” or “products.”
What Does This Mean?
This impacts any plugin or theme that extends Give with these hooks. The best way to find out whether your website is affected by this at all, is the following:
- Install Give 1.7
Once you’ve done that you potentially will see something like this on your page:
Note that these notices will ONLY appear if you have
WP_DEBUG enabled. Depending on exactly what the hook does for your site, functionality might be impaired as well.
What Do I Do About it?
Generally, all you need to do is update your action to use the new nomenclature. If your hook uses the words “product” or “purchase” both of those have consistently been changed to “donation.” But it’s best to review the deprecated notice folder closely.
If you see the PHP notice like above, you’ll notice that it tells you exactly what you should change your hook to and where exactly you’ll find it as well. Deprecated hooks won’t break, they will only display a notice. This is important because we believe maintaining backwards compatibility is super important.
Some Changes Aren’t Fun, but Necessary
There are more hooks that will need to be changed eventually. This is just the first rollout. We didn’t want to introduce ALL the deprecations in one big update. If you are a developer and extending Give for your clients, here are several ways to stay current so these types of changes don’t catch you off-guard:
- The best way is to follow our development on Github.
- Subscribe to our Give Newsletter. We promise to ALWAYS keep you posted on upcoming breaking changes via our blog.
- If you build sites for clients with Give and want to stay “in the know,” we’d love to have you join our Give Community Slack Channel. Reach out to us via our Contact Form and we’ll send you an invite.