The inheritance pattern used by the WC_Data families enables a standard pattern for the action and filter hooks available to developers making it easy to quickly modify behavior across WooCommerce. Once you’re aware of the standard hooks that you can expect to be available to you, you can skip the process of searching through the documentation and codebase, Unless you like spending hours with search engines, Stack Exchange, and IDE searches and insert your custom code using the standard patterns.
Let’s take a look at what that entails…….
WooCommerce also provides action hooks before and after a database save, with access to the object$this, and it’s data store$this->data_store
This concludes our outline of the WC_Data approach to action and filter hooks. You should now be able to confidently navigate to filters and actions that will allow you to extensively customize the behavior of WooCommerce, without breaking into “heavy coding”
In the next section, we’ll look at another method to achieve even further customization in WooCommerce through a more robust method: extending the WC_Data classes
But let make sure you’ve got the core concepts down first.
0 of 3 Questions completed
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 3 Questions answered correctly
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
What is the purpose of WC_Data’s get_hook_prefix()?
(T/F) All Booleans methods for WC_Data objects are unfiltered
Where’s all (most of) the action at?