# tier-pricing-table/8.0.2/src/Blocks/GutenbergBlocks.php

Tiered Pricing Table for WooCommerce, version 8.0.2. 47 lines.

- Page: https://pluginprobe.com/plugins/tier-pricing-table/8.0.2/code/src/Blocks/GutenbergBlocks.php
- Raw: https://pluginprobe.com/plugins/tier-pricing-table/8.0.2/raw/src/Blocks/GutenbergBlocks.php
- Modified: 2026-06-26T14:29:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tier-pricing-table/8.0.2/code/src/Blocks/GutenbergBlocks.php#L10-L20`.

```php
<?php namespace TierPricingTable\Blocks;

use TierPricingTable\PricingTable;
use WP_Post;

class GutenbergBlocks {

	public function __construct() {

		register_block_type( __DIR__ . '/build', array(
			'render_callback' => function ( $attributes, $content ) {

				$attributes = wp_parse_args( $attributes, array(
					'displayType'         => 'table',
					'activeTierColor'     => '#3858e9',
					'title'               => '',
					'showDiscountColumn'  => true,
					'quantityColumnTitle' => '',
					'discountColumnTitle' => '',
					'priceColumnTitle'    => '',
				) );

				global $post;

				if ( ! ( $post instanceof WP_Post ) ) {
					return '';
				}

				ob_start();
				PricingTable::getInstance()->renderPricingTable( $post->ID, null, array(
					'display_type'          => $attributes['displayType'],
					'active_tier_color'     => $attributes['activeTierColor'],
					'title'                 => $attributes['title'],
					'show_discount_column'  => $attributes['showDiscountColumn'],
					'discount_column_title' => $attributes['discountColumnTitle'],
					'price_column_title'    => $attributes['priceColumnTitle'],
					'quantity_column_title' => $attributes['quantityColumnTitle'],
				) );

				return ob_get_clean();
			},
		) );
	}
}



```
