Automattic\WooCommerce\Blocks\BlockTypes\AddToCartWithOptions
AddToCartWithOptions::is_wishlist_enabled
Whether the wishlist feature is enabled.
Gates the render-time injection of the Add to Wishlist Button block (and its editor preview), so the button only appears while the (experimental, feature-flagged) wishlist feature is on.
Method of the class: AddToCartWithOptions{}
No Hooks.
Returns
true|false. True if the wishlist feature flag is enabled, false otherwise.
Usage
// private - for code of main (parent) class only $result = $this->is_wishlist_enabled(): bool;
AddToCartWithOptions::is_wishlist_enabled() AddToCartWithOptions::is wishlist enabled code WC 10.9.3
private function is_wishlist_enabled(): bool {
return wc_get_container()->get( ShopperListsController::class )->is_enabled( 'wishlist' );
}