# m-chart/2.3.2/components/block/chart/render.php

M Chart, version 2.3.2. 22 lines.

- Page: https://pluginprobe.com/plugins/m-chart/2.3.2/code/components/block/chart/render.php
- Raw: https://pluginprobe.com/plugins/m-chart/2.3.2/raw/components/block/chart/render.php
- Modified: 2026-07-01T03:15:44+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/m-chart/2.3.2/code/components/block/chart/render.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Server-side rendering of the `wtblocks/chart` block
 *
 * $attributes (array): The block attributes
 * $content (string): The block default content
 * $block (WP_Block): The block instance
 */

$chart_id = $attributes['chartId'] ?? null;

if ( ! empty( $chart_id ) ) :
	$allowed_show = [ 'chart', 'image', 'table' ];
	$show         = in_array( $attributes['show'] ?? '', $allowed_show, true ) ? $attributes['show'] : 'chart';

	echo '[m-chart id="' . absint( $chart_id ) . '" show="' . esc_attr( $show ) . '"]';
endif;

```
