Hi
I was wondering can I include css/js inside a custom block which will only load inside the block editor? so no front end loading.
I do not want to include these within my theme or inside one css/js file, I ideally wanted to call this inside the setup of the meta block. Can i replace 'wp_enqueue_style' with 'enqueue_block_editor_assets'?
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
$meta_boxes[] = [
'title' => 'Product Listing Block',
'id' => 'dc-product-listing-block',
'description' => 'Product listings for your store',
'type' => 'block',
'icon' => 'screenoptions',
'category' => 'dc-blocks',
'context' => 'side',
'render_template' => __DIR__ . '/template.php',
'enqueue_assets' => function() {
wp_enqueue_style( 'example', 'folder/example.css', [], '1.8.1' );
},
];
return $meta_boxes;
} );
}