Added support for front-end rendering
This commit is contained in:
@ -17,6 +17,7 @@ if (!defined('ABSPATH')) {
|
||||
|
||||
// Include block files
|
||||
require_once plugin_dir_path(__FILE__) . 'blocks/bar-graph/lcp-bar-graph.php';
|
||||
require_once plugin_dir_path(__FILE__) . 'blocks/bar-graph/render.php';
|
||||
|
||||
/**
|
||||
* Add custom category for LCP blocks
|
||||
@ -35,6 +36,16 @@ function lcp_block_categories($categories) {
|
||||
}
|
||||
add_filter('block_categories_all', 'lcp_block_categories', 10, 1);
|
||||
|
||||
function create_block_lcp_data_blocks_block_init() {
|
||||
register_block_type(
|
||||
__DIR__ . '/blocks/bar-graph/build',
|
||||
array(
|
||||
'render_callback' => 'lcp_render_bar_graph_block'
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action('init', 'create_block_lcp_data_blocks_block_init');
|
||||
|
||||
// Register the Data Collection Custom Post Type
|
||||
function lcp_register_data_collection_post_type() {
|
||||
$labels = array(
|
||||
|
||||
Reference in New Issue
Block a user