PluginProbe
M Chart / 2.3
M Chart v2.3
2.3.2 2.3.1 2.3 2.2.2 2.2.1 2.2 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.10 1.10.1 1.11 1.11.1 1.11.2 1.12 1.2 1.2.1 1.3 1.3.1 1.3.2 All 53 releases
m-chart / components / block / chart / render.php

render.php in M Chart 2.3, at components/block/chart/render.php

22 lines 574 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 /**
7 * Server-side rendering of the `wtblocks/chart` block
8 *
9 * $attributes (array): The block attributes
10 * $content (string): The block default content
11 * $block (WP_Block): The block instance
12 */
13
14 $chart_id = $attributes['chartId'] ?? null;
15
16 if ( ! empty( $chart_id ) ) :
17 $allowed_show = [ 'chart', 'image', 'table' ];
18 $show = in_array( $attributes['show'] ?? '', $allowed_show, true ) ? $attributes['show'] : 'chart';
19
20 echo '[m-chart id="' . absint( $chart_id ) . '" show="' . esc_attr( $show ) . '"]';
21 endif;
22