File tree Expand file tree Collapse file tree
includes/blocks/block-editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ function register() {
3232 * Enqueue block assets.
3333 */
3434function enqueue_block_assets () {
35+ // Only enqueue the script on frontend when the block exists
36+ if ( ! is_admin () && ! has_block ( '10up/tabs-item ' ) ) {
37+ return ;
38+ }
39+
3540 $ asset_file = include PUBLISHER_MEDIA_KIT_PATH . 'dist/blocks/tabs-item-block.asset.php ' ;
3641
3742 wp_enqueue_script (
Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ function register() {
3232 * Enqueue block assets.
3333 */
3434function enqueue_block_assets () {
35+ // Only enqueue the script on frontend when the block exists
36+ if ( ! is_admin () && ! has_block ( '10up/tabs ' ) ) {
37+ return ;
38+ }
39+
3540 $ asset_file = include PUBLISHER_MEDIA_KIT_PATH . 'dist/blocks/tabs-block.asset.php ' ;
3641
3742 wp_enqueue_script (
You can’t perform that action at this time.
0 commit comments