Automattic\WooCommerce\Internal\ProductAttributesLookup
LookupDataStore::is_published_variation
Check if a value is a published variation.
Method of the class: LookupDataStore{}
No Hooks.
Returns
bool.
Usage
// private - for code of main (parent) class only $result = $this->is_published_variation( $product ): bool;
- $product(mixed) (required)
- Product object, or false when the product couldn't be loaded.
LookupDataStore::is_published_variation() LookupDataStore::is published variation code WC 11.3.0
private function is_published_variation( $product ): bool {
return $product instanceof \WC_Product_Variation && ProductStatus::PUBLISH === $product->get_status( 'edit' );
}