WordPress action hook

woocommerce_share

Defined by WooCommerce and fired by 6 plugins in total, running on 7M+ sites between them.

How to use woocommerce_share

It's an action: your callback runs at that point. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'woocommerce_share', function() {
	// Your code runs here.
}, 10, 1 );

Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

6 plugins that fire woocommerce_share

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs do_action( 'woocommerce_share' ) templates/single-product/share.php:24
  2. Fable Extra icon Fable Extra4,000+ installs do_action( 'woocommerce_share' ) inc/woo-features/fable-extra-quick-view.php:102
  3. Kadence for WooCommerce and Elementor icon Kadence for WooCommerce and Elementor3,000+ installs do_action( 'woocommerce_share' ) inc/elementor-widgets/product-social.php:61
  4. Easy 3D Viewer icon Easy 3D Viewer1,000+ installs do_action( 'woocommerce_share' ) includes/woo3dv-product-single-compat.php:102
  5. StoreBuild icon StoreBuild400+ installs do_action( 'woocommerce_share' ) public/woocommerce/single-product/share.php:24
  6. WooLayout icon WooLayout10+ installs do_action( 'woocommerce_share' ) lib/woolayout/single-product/share.php:24

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.