'lcp-bar-graph', 'editor_style' => ['ag-grid', 'ag-grid-theme', 'lcp-bar-graph-editor'], 'render_callback' => 'render_block_lcp_bar_graph' )); } add_action('init', 'lcp_visualize_register_blocks'); function render_block_lcp_bar_graph($attributes) { wp_enqueue_style('ag-grid'); wp_enqueue_style('ag-grid-theme'); wp_enqueue_style('lcp-bar-graph-editor'); $wrapper_attributes = get_block_wrapper_attributes([ 'class' => 'wp-block-lcp-bar-graph' ]); $chart_data = $attributes['chartData'] ?? []; $chart_data_json = wp_json_encode($chart_data); ob_start(); ?>