Automattic\WooCommerce\Blocks
BlockTypesController::get_block_types() │ protected │ WC 1.0
Get list of block types.
Method of the class: BlockTypesController{}
No Hooks.
Return
Array
.
Usage
// protected - for code of main (parent) or child class $result = $this->get_block_types();
BlockTypesController::get_block_types() BlockTypesController::get block types code WC 8.7.0
protected function get_block_types() { global $pagenow; $block_types = array( 'ActiveFilters', 'AddToCartForm', 'AllProducts', 'AllReviews', 'AttributeFilter', 'Breadcrumbs', 'CatalogSorting', 'ClassicTemplate', 'ClassicShortcode', 'CustomerAccount', 'FeaturedCategory', 'FeaturedProduct', 'FilterWrapper', 'HandpickedProducts', 'MiniCart', 'StoreNotices', 'PriceFilter', 'ProductAddToCart', 'ProductBestSellers', 'ProductButton', 'ProductCategories', 'ProductCategory', 'ProductCollection', 'ProductCollectionNoResults', 'ProductGallery', 'ProductGalleryLargeImage', 'ProductGalleryLargeImageNextPrevious', 'ProductGalleryPager', 'ProductGalleryThumbnails', 'ProductImage', 'ProductImageGallery', 'ProductNew', 'ProductOnSale', 'ProductPrice', 'ProductTemplate', 'ProductQuery', 'ProductAverageRating', 'ProductRating', 'ProductRatingCounter', 'ProductRatingStars', 'ProductResultsCount', 'ProductReviews', 'ProductSaleBadge', 'ProductSearch', 'ProductSKU', 'ProductStockIndicator', 'ProductSummary', 'ProductTag', 'ProductTitle', 'ProductTopRated', 'ProductsByAttribute', 'RatingFilter', 'ReviewsByCategory', 'ReviewsByProduct', 'RelatedProducts', 'ProductDetails', 'SingleProduct', 'StockFilter', 'PageContentWrapper', 'OrderConfirmation\Status', 'OrderConfirmation\Summary', 'OrderConfirmation\Totals', 'OrderConfirmation\TotalsWrapper', 'OrderConfirmation\Downloads', 'OrderConfirmation\DownloadsWrapper', 'OrderConfirmation\BillingAddress', 'OrderConfirmation\ShippingAddress', 'OrderConfirmation\BillingWrapper', 'OrderConfirmation\ShippingWrapper', 'OrderConfirmation\AdditionalInformation', 'OrderConfirmation\AdditionalFieldsWrapper', 'OrderConfirmation\AdditionalFields', ); $block_types = array_merge( $block_types, Cart::get_cart_block_types(), Checkout::get_checkout_block_types(), MiniCartContents::get_mini_cart_block_types() ); if ( Package::feature()->is_experimental_build() ) { $block_types[] = 'ProductFilter'; $block_types[] = 'ProductFilterStockStatus'; $block_types[] = 'ProductFilterPrice'; $block_types[] = 'ProductFilterAttribute'; $block_types[] = 'ProductFilterRating'; $block_types[] = 'ProductFilterActive'; } /** * This disables specific blocks in Widget Areas by not registering them. */ if ( in_array( $pagenow, array( 'widgets.php', 'themes.php', 'customize.php' ), true ) && ( empty( $_GET['page'] ) || 'gutenberg-edit-site' !== $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification $block_types = array_diff( $block_types, array( 'AllProducts', 'Cart', 'Checkout', ) ); } /** * This disables specific blocks in Post and Page editor by not registering them. */ if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ), true ) ) { $block_types = array_diff( $block_types, array( 'AddToCartForm', 'Breadcrumbs', 'CatalogSorting', 'ClassicTemplate', 'ProductResultsCount', 'ProductDetails', 'OrderConfirmation\Status', 'OrderConfirmation\Summary', 'OrderConfirmation\Totals', 'OrderConfirmation\TotalsWrapper', 'OrderConfirmation\Downloads', 'OrderConfirmation\DownloadsWrapper', 'OrderConfirmation\BillingAddress', 'OrderConfirmation\ShippingAddress', 'OrderConfirmation\BillingWrapper', 'OrderConfirmation\ShippingWrapper', 'OrderConfirmation\AdditionalInformation', 'OrderConfirmation\AdditionalFieldsWrapper', 'OrderConfirmation\AdditionalFields', ) ); } return $block_types; }