/woocommerce-commerce:woo-hooks-filtersfrom woocommerce-commerce
Master the WordPress hook system for WooCommerce — actions, filters, priorities, and extensibility patterns. Use when adding functionality via hooks or understanding WooCommerce execution flow.
Ships in woocommerce-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
https://developer.wordpress.org/plugins/hooks/ for WordPress Hooks fundamentalssite:developer.woocommerce.com hooks for WooCommerce-specific hookswoocommerce action filter reference for comprehensive hook listingsFire at specific points in execution — used for side effects (sending emails, writing logs, rendering HTML):
do_action( 'hook_name', $arg1, $arg2 ) — fires the actionadd_action( 'hook_name', 'callback', $priority, $accepted_args ) — registers a listenerremove_action( 'hook_name', 'callback', $priority ) — unregisters a listener$priority = runs earlier (default 10)Transform data as it flows through the system — must return a value:
apply_filters( 'filter_name', $value, $arg1, $arg2 ) — applies the filteradd_filter( 'filter_name', 'callback', $priority, $accepted_args ) — registers a filter$value as first argument, must return the (possibly modified) value10| Hook | Type | When |
|---|---|---|
woocommerce_product_get_price | Filter | Price is retrieved |
woocommerce_before_single_product | Action | Before product page renders |
woocommerce_after_single_product_summary | Action | After product summary |
woocommerce_product_options_general_product_data | Action | General tab in product edit |
woocommerce_process_product_meta | Action | Product is saved |
| Hook | Type | When |
|---|---|---|
woocommerce_before_cart | Action | Before cart page |
woocommerce_cart_calculate_fees | Action | Calculate cart fees |
woocommerce_before_calculate_totals | Action | Before totals calculation |
woocommerce_add_to_cart | Action | Item added to cart |
woocommerce_cart_item_price | Filter | Cart item price display |
| Hook | Type | When |
|---|---|---|
woocommerce_before_checkout_form | Action | Before checkout form |
woocommerce_checkout_fields | Filter | Modify checkout fields |
woocommerce_checkout_process | Action | Validate checkout |
woocommerce_checkout_order_processed | Action | Order created from checkout |
woocommerce_payment_complete | Action | Payment completed |
| Hook | Type | When |
|---|---|---|
woocommerce_order_status_changed | Action | Order status transition |
woocommerce_order_status_{from}_to_{to} | Action | Specific status transition |
woocommerce_new_order | Action | New order created |
woocommerce_thankyou | Action | Thank-you page |
| Hook | Type | When |
|---|---|---|
woocommerce_admin_order_data_after_order_details | Action | After order details in admin |
woocommerce_product_data_tabs | Filter | Product data tabs |
woocommerce_product_data_panels | Action | Product data panels content |
woocommerce_get_settings_pages | Filter | Register settings pages |
| Hook | Type | When |
|---|---|---|
woocommerce_init | Action | WooCommerce initialized |
woocommerce_loaded | Action | WooCommerce classes loaded |
before_woocommerce_init | Action | Before WC initializes (declare features here) |
woocommerce_after_register_taxonomy | Action | After taxonomies registered |
Register hooks only when needed:
is_admin() — admin-only hookswp_doing_ajax() — AJAX-only hooksis_checkout(), is_cart() — page-specific hooksUse class methods as callbacks: add_action( 'hook', [ $this, 'method' ] ) or add_action( 'hook', [ __CLASS__, 'static_method' ] )
remove_action() / remove_filter() with the exact callback and priority that was used to add it. For class methods on singletons, reference the instance: remove_action( 'hook', [ WC()->structured_data, 'method' ] )
WooCommerce uses dynamic hooks based on context:
woocommerce_product_get_{$prop} — getter filter for any product propertywoocommerce_order_status_{$status} — status-specific actionwoocommerce_widget_{$widget_id}_args — widget-specific filter$accepted_args when your callback needs more than one argumentadd_filter over directly modifying globalshas_action() / has_filter() to check if a hook is already registereddo_action() / apply_filters() on WooCommerce core hooks from your code (fire your own hooks instead)do_action( 'my_extension_after_process', $data )Fetch the WooCommerce hook reference for current hook names, parameters, and deprecation notices before implementing.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin woocommerce-commerce20 skills in this plugin
/php-modernWrite modern PHP 8.x code — typed properties, enums, readonly classes, match expressions, named arguments, union/intersection types, fibers, attributes, and constructor promotion. Use when writing PHP for WooCommerce or any PHP 8.x project./php-patternsApply PHP design patterns — Singleton, Factory, Strategy, Observer, Repository, Decorator, and Dependency Injection in PHP. Use when structuring WooCommerce extension code or implementing complex business logic./php-testingWrite PHP tests with PHPUnit — unit tests, mocking, data providers, assertions, test doubles, and TDD workflow. Use when writing tests for WooCommerce extensions or PHP projects./woo-adminBuild WooCommerce admin interfaces — settings pages, admin menus, product data tabs/panels, order meta boxes, WooCommerce Admin (React analytics), and reports. Use when creating admin-facing configuration or display pages./woo-apiBuild and consume WooCommerce REST API v3 endpoints — authentication, custom endpoints, extending existing resources, webhooks, and batch operations. Use when creating custom API endpoints or integrating external systems with WooCommerce./woo-blocksBuild WooCommerce Blocks — Gutenberg block integration, block-based cart/checkout extensions, Store API, and the @woocommerce/blocks-checkout package. Use when extending the block editor for WooCommerce or customizing block-based checkout/cart.Other plugins' skills for the same job