Deprecated Hooks in Give 1.7

Give 1.7 is helping future-proof our code by deprecating some filters, actions, and hooks. Here's what that means for developers.
Give 1.7 Deprecated Hooks

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.”

Click here to see a list of all the deprecated actions, filters, and functions.

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:

  1. Install Give 1.7
  2. Enable WP_DEBUG

Once you’ve done that you potentially will see something like this on your page:

Give 1.7 Deprecated Notice Warning
Give 1.7 Deprecated Notice Warning

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:

  1. The best way is to follow our development on Github.
  2. Subscribe to our Give Newsletter. We promise to ALWAYS keep you posted on upcoming breaking changes via our blog.
  3. 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.

 

About the Author

Share this post

Join Our Newsletter

Get fundraising insights directly in your inbox. Plus a 15% discount off all plans.

  • This field is for validation purposes and should be left unchanged.

Copyright © 2024 Liquid Web, L.L.C.

GiveWP™ is a trademark of Liquid Web, L.L.C.

A Liquid Web Brand

© 2024 All Rights Reserved.