woocommerce_product_attributes_filterer_hide_out_of_stock filter-hookWC 9.8.0.

Filters the woocommerce_hide_out_of_stock_items option to override the default behavior in product filtering by attribute.

Usage

add_filter( 'woocommerce_product_attributes_filterer_hide_out_of_stock', 'wp_kama_woocommerce_product_attributes_filterer_hide_out_of_stock_filter' );

/**
 * Function for `woocommerce_product_attributes_filterer_hide_out_of_stock` filter-hook.
 * 
 * @param bool $option_value The behavior configured in WooCommerce settings.
 *
 * @return bool
 */
function wp_kama_woocommerce_product_attributes_filterer_hide_out_of_stock_filter( $option_value ){

	// filter...
	return $option_value;
}
$option_value(true|false)
The behavior configured in WooCommerce settings.

Changelog

Since 9.8.0. Introduced.

Where the hook is called

Filterer::filter_by_attribute_post_clauses()
woocommerce_product_attributes_filterer_hide_out_of_stock
Filterer::get_product_counts_query_using_lookup_table()
woocommerce_product_attributes_filterer_hide_out_of_stock
woocommerce/src/Internal/ProductAttributesLookup/Filterer.php 78
$hide_out_of_stock = apply_filters( 'woocommerce_product_attributes_filterer_hide_out_of_stock', 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) );
woocommerce/src/Internal/ProductAttributesLookup/Filterer.php 225
$hide_out_of_stock = apply_filters( 'woocommerce_product_attributes_filterer_hide_out_of_stock', 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) );

Where the hook is used in WooCommerce

Usage not found.