woocommerce_hide_invisible_variations

woocommerce_hide_invisible_variations

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

apply_filters('woocommerce_hide_invisible_variations') is found 2 times:

  • /includes/class-wc-product-variable.php line 323
    				continue;
    			}
    
    			// Filter 'woocommerce_hide_invisible_variations' to optionally hide invisible variations (disabled variations and variations with empty price).
    			if ( apply_filters( 'woocommerce_hide_invisible_variations', true, $this->get_id(), $variation ) && ! $variation->variation_is_visible() ) {
    				continue;
    			}
    
    			if ( 'array' === $return ) {
    				$available_variations[] = $this->get_available_variation( $variation );
    			} else {
    
  • /includes/class-wc-product-variable.php line 355
    			return false;
    		}
    
    		// Filter 'woocommerce_hide_invisible_variations' to optionally hide invisible variations (disabled variations and variations with empty price).
    		if ( apply_filters( 'woocommerce_hide_invisible_variations', true, $this->get_id(), $variation ) && ! $variation->variation_is_visible() ) {
    			return false;
    		}
    
    		return true;
    	}