Hooks
WooCommerce hook on product updated or added
WooCommerce doesn’t provide a hook which runs when a product is saved or updated in the admin. Find out which WordPress hooks to use for this action.
Create WooCommerce coupons programmatically
Create a WooCommerce coupon in code using the woocommerce_get_shop_coupon_data filter. Useful for validating a coupon with an external API.
Tags: coupons, hooks, woocommerce
Debug WordPress by logging hook calls
Learn how to log every action and filter hook call in WordPress. Identify which processes are running and which are resource intensive and need optimising.
Gravity Forms count uploaded files programmatically
Gravity Forms offers a very nice multi-file upload function, allowing multiple images to be attached to a form. This snippet counts the number of uploaded files and submits the count as a read-only field on the form.
Tags: gravity forms, hooks, wordpress
Customising WooCommerce notification emails with hooks and filters
WooCommerce has many hooks to customise the email notifications sent at various stages of the purchase process, but these are not very well documented. Find out how to use some of these useful filters.
Tags: filters, hooks, notification emails, woocommerce