PATH:
home
/
ediuae
/
agrivaingredients.com
/
wp-content
/
plugins
/
woocommerce
/
src
/
Blocks
/
BlockTypes
<?php // phpcs:ignore Generic.PHP.RequireStrictTypes.MissingDeclaration namespace Automattic\WooCommerce\Blocks\BlockTypes; use Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock; use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; use Automattic\WooCommerce\Internal\EmailEditor\WooContentProcessor; use Automattic\WooCommerce\Internal\Admin\EmailPreview\EmailPreview; /** * EmailContent class. */ class EmailContent extends AbstractBlock { /** * Block name. * * @var string */ protected $block_name = 'email-content'; /** * Get the frontend style handle for this block type. * * @return null */ protected function get_block_type_style() { return null; } /** * Get the editor script handle for this block type. * * @param string $key Data to get, or default to everything. * @return array|string */ protected function get_block_type_editor_script( $key = null ) { $script = [ 'handle' => 'wc-' . $this->block_name . '-block', 'path' => $this->asset_api->get_block_asset_build_path( $this->block_name ), 'dependencies' => [ 'wc-blocks' ], ]; return $key ? $script[ $key ] : $script; } /** * Get the frontend script handle for this block type. * * @param string $key Data to get, or default to everything. */ protected function get_block_type_script( $key = null ) { return null; } /** * Renders the block preview for the editor. * * @param array $attributes Block attributes. * @return string Rendered block output. */ protected function render_preview( $attributes ) { /** * Email preview instance for rendering dummy content. * * @var EmailPreview $email_preview - email preview instance */ $email_preview = wc_get_container()->get( EmailPreview::class ); $type_param = EmailPreview::DEFAULT_EMAIL_TYPE; if ( isset( $attributes['emailType'] ) ) { $type_param = sanitize_text_field( wp_unslash( $attributes['emailType'] ) ); } try { return $email_preview->generate_placeholder_content( $type_param ); } catch ( \Exception $e ) { // Catch other potential errors during content generation. return esc_html__( 'There was an error rendering the email preview.', 'woocommerce' ); } } /** * Renders Woo content placeholder to be replaced by content during sending. * * @param array $attributes Block attributes. * @param string $content Block content. * @param \WP_Block $block Block instance. * @return string Rendered block output. */ protected function render( $attributes, $content, $block ) { // phpcs:disable WordPress.Security.NonceVerification.Recommended if ( defined( 'REST_REQUEST' ) && REST_REQUEST && isset( $_GET['context'] ) && 'edit' === sanitize_text_field( wp_unslash( $_GET['context'] ) ) ) { // Block is being rendered for ServerSideRender editor preview. return $this->render_preview( $attributes ); } return BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER; } }
[+]
..
[-] CartItemsBlock.php
[edit]
[-] AllReviews.php
[edit]
[-] ProductFilterClearButton.php
[edit]
[-] CartOrderSummaryFeeBlock.php
[edit]
[-] CartCrossSellsBlock.php
[edit]
[-] CheckoutBillingAddressBlock.php
[edit]
[-] CartOrderSummaryTaxesBlock.php
[edit]
[-] ProductTag.php
[edit]
[-] CartExpressPaymentBlock.php
[edit]
[-] AbstractProductGrid.php
[edit]
[-] ProductSummary.php
[edit]
[-] AbstractBlock.php
[edit]
[-] CheckoutActionsBlock.php
[edit]
[-] CheckoutExpressPaymentBlock.php
[edit]
[-] ReviewsByCategory.php
[edit]
[-] CheckoutOrderSummaryBlock.php
[edit]
[-] ProductGalleryThumbnails.php
[edit]
[-] MiniCartTitleLabelBlock.php
[edit]
[-] ComingSoon.php
[edit]
[-] ClassicTemplate.php
[edit]
[+]
Accordion
[-] FeaturedProduct.php
[edit]
[-] ProductSKU.php
[edit]
[-] PaymentMethodIcons.php
[edit]
[-] PriceFilter.php
[edit]
[-] CheckoutAdditionalInformationBlock.php
[edit]
[-] CheckoutContactInformationBlock.php
[edit]
[-] CartOrderSummaryHeadingBlock.php
[edit]
[-] FilledMiniCartContentsBlock.php
[edit]
[-] ProductCategory.php
[edit]
[-] CartLineItemsBlock.php
[edit]
[-] ProductResultsCount.php
[edit]
[-] ReviewsByProduct.php
[edit]
[+]
ProductCollection
[-] AtomicBlock.php
[edit]
[-] ActiveFilters.php
[edit]
[-] CheckoutOrderSummaryCouponFormBlock.php
[edit]
[-] EnableBlockJsonAssetsTrait.php
[edit]
[-] CartOrderSummaryTotalsBlock.php
[edit]
[-] CheckoutTermsBlock.php
[edit]
[-] ProductOnSale.php
[edit]
[-] PageContentWrapper.php
[edit]
[-] CartOrderSummarySubtotalBlock.php
[edit]
[-] ProductSaleBadge.php
[edit]
[-] CategoryTitle.php
[edit]
[-] ProductGalleryLargeImage.php
[edit]
[-] ProductTemplate.php
[edit]
[-] ProductFilterCheckboxList.php
[edit]
[-] MiniCartCheckoutButtonBlock.php
[edit]
[-] ProductsByAttribute.php
[edit]
[-] EmailContent.php
[edit]
[-] ProductQuery.php
[edit]
[-] CheckoutShippingMethodBlock.php
[edit]
[-] ProductFilterAttribute.php
[edit]
[-] ProductDescription.php
[edit]
[-] CheckoutOrderSummaryDiscountBlock.php
[edit]
[-] MiniCartContents.php
[edit]
[-] ProductFilterTaxonomy.php
[edit]
[-] CheckoutOrderSummarySubtotalBlock.php
[edit]
[-] CheckoutOrderSummaryTaxesBlock.php
[edit]
[-] CartOrderSummaryCouponFormBlock.php
[edit]
[-] FeaturedItem.php
[edit]
[-] CartLink.php
[edit]
[-] CustomerAccount.php
[edit]
[-] SingleProduct.php
[edit]
[-] FeaturedCategory.php
[edit]
[-] FilterWrapper.php
[edit]
[-] EmptyCartBlock.php
[edit]
[-] ProductFilterChips.php
[edit]
[-] ProductImageGallery.php
[edit]
[-] ProductTopRated.php
[edit]
[+]
Reviews
[-] CartOrderSummaryShippingBlock.php
[edit]
[+]
AddToCartWithOptions
[-] ProductAverageRating.php
[edit]
[-] CheckoutShippingAddressBlock.php
[edit]
[-] ProductFilterActive.php
[edit]
[-] ProductPrice.php
[edit]
[-] ProductStockIndicator.php
[edit]
[-] CheckoutTotalsBlock.php
[edit]
[-] MiniCartCartButtonBlock.php
[edit]
[-] CheckoutPickupOptionsBlock.php
[edit]
[-] CartAcceptedPaymentMethodsBlock.php
[edit]
[-] ProductSpecifications.php
[edit]
[-] CheckoutOrderNoteBlock.php
[edit]
[-] ProductFilterPrice.php
[edit]
[-] ProductButton.php
[edit]
[-] MiniCart.php
[edit]
[-] HandpickedProducts.php
[edit]
[-] AttributeFilter.php
[edit]
[-] ProductMeta.php
[edit]
[-] MiniCartShoppingButtonBlock.php
[edit]
[-] ProductImage.php
[edit]
[+]
OrderConfirmation
[-] CheckoutOrderSummaryFeeBlock.php
[edit]
[-] MiniCartItemsBlock.php
[edit]
[-] RatingFilter.php
[edit]
[-] StockFilter.php
[edit]
[-] ProductRating.php
[edit]
[-] MiniCartTitleItemsCounterBlock.php
[edit]
[-] CheckoutFieldsBlock.php
[edit]
[-] StoreNotices.php
[edit]
[-] Checkout.php
[edit]
[-] CartOrderSummaryBlock.php
[edit]
[-] MiniCartTitleBlock.php
[edit]
[-] MiniCartProductsTableBlock.php
[edit]
[-] ProductFilterStatus.php
[edit]
[-] ProductDetails.php
[edit]
[-] CartTotalsBlock.php
[edit]
[-] CartCrossSellsProductsBlock.php
[edit]
[-] EmptyMiniCartContentsBlock.php
[edit]
[-] ProductSearch.php
[edit]
[-] CheckoutOrderSummaryTotalsBlock.php
[edit]
[-] ProductBestSellers.php
[edit]
[-] AddToCartForm.php
[edit]
[-] ProductFilterPriceSlider.php
[edit]
[-] Cart.php
[edit]
[-] RelatedProducts.php
[edit]
[-] ClassicShortcode.php
[edit]
[-] ProductFilterRating.php
[edit]
[-] AbstractDynamicBlock.php
[edit]
[-] ProductTitle.php
[edit]
[-] CheckoutShippingMethodsBlock.php
[edit]
[-] CheckoutOrderSummaryShippingBlock.php
[edit]
[-] CheckoutOrderSummaryCartItemsBlock.php
[edit]
[-] CheckoutPaymentBlock.php
[edit]
[-] ProductRatingStars.php
[edit]
[-] ProductGallery.php
[edit]
[-] NextPreviousButtons.php
[edit]
[-] ProductFilters.php
[edit]
[-] ProductRatingCounter.php
[edit]
[-] ProductCategories.php
[edit]
[-] FilledCartBlock.php
[edit]
[-] CategoryDescription.php
[edit]
[-] CatalogSorting.php
[edit]
[-] AbstractInnerBlock.php
[edit]
[-] Breadcrumbs.php
[edit]
[-] ProductNew.php
[edit]
[-] MiniCartFooterBlock.php
[edit]
[-] ProductFilterRemovableChips.php
[edit]
[-] CartOrderSummaryDiscountBlock.php
[edit]
[-] ProceedToCheckoutBlock.php
[edit]
[-] AllProducts.php
[edit]