woocommerce_is_downloadable
Checks if a product is downloadable.
Использование
add_filter( 'woocommerce_is_downloadable', 'wp_kama_woocommerce_is_downloadable_filter', 10, 2 );
/**
* Function for `woocommerce_is_downloadable` filter-hook.
*
* @param $true === $this->get_downloadable
* @param $that
*
* @return
*/
function wp_kama_woocommerce_is_downloadable_filter( $true === $this->get_downloadable, $that ){
// filter...
return $true === $this->get_downloadable;
}
- $true === $this->get_downloadable
- -
- $that
- -
Где вызывается хук
woocommerce_is_downloadable
woocommerce/includes/abstracts/abstract-wc-product.php 1618
return apply_filters( 'woocommerce_is_downloadable', true === $this->get_downloadable(), $this );
Где используется хук в WooCommerce
woocommerce/src/Internal/Admin/EmailPreview/EmailPreview.php 632
add_filter( 'woocommerce_is_downloadable', array( $this, 'force_product_downloadable' ), 10, 1 );
woocommerce/src/Internal/Admin/EmailPreview/EmailPreview.php 646
remove_filter( 'woocommerce_is_downloadable', array( $this, 'force_product_downloadable' ), 10 );