| | |
| | | //require(JVB_DIR . '/inc/blocks/RegisterBlocks.php'); |
| | | require(JVB_DIR . '/inc/blocks/CustomBlocks.php'); |
| | | |
| | | if (Site::has('feed_block')) { |
| | | require(JVB_DIR . '/inc/blocks/FeedBlock.php'); |
| | | new JVBase\blocks\FeedBlock(); |
| | | |
| | | add_action('init', 'jvb_conditionally_load_blocks', 1); |
| | | function jvb_conditionally_load_blocks(): void |
| | | { |
| | | if (Site::has('feed_block')) { |
| | | require(JVB_DIR . '/inc/blocks/FeedBlock.php'); |
| | | new JVBase\blocks\FeedBlock(); |
| | | } |
| | | |
| | | if (Site::has('is_restaurant')) { |
| | | require(JVB_DIR . '/inc/blocks/MenuBlock.php'); |
| | | new JVBase\blocks\MenuBlock(); |
| | | } |
| | | |
| | | if (Site::has('faq')) { |
| | | require(JVB_DIR . '/inc/blocks/FAQBlock.php'); |
| | | new JVBase\blocks\FAQBlock(); |
| | | } |
| | | |
| | | if (!empty(Registrar::getFeatured('is_glossary'))) { |
| | | require(JVB_DIR . '/inc/blocks/GlossaryBlock.php'); |
| | | new JVBase\blocks\GlossaryBlock(); |
| | | } |
| | | |
| | | if (!empty(Registrar::getFeatured('is_timeline'))) { |
| | | require(JVB_DIR . '/inc/blocks/TimelineBlock.php'); |
| | | new JVBase\blocks\TimelineBlock(); |
| | | } |
| | | |
| | | if (Site::hasIntegration('gmb')) { |
| | | require(JVB_DIR . '/build/gmbreviews/render.php'); |
| | | register_block_type( |
| | | JVB_DIR . '/build/gmbreviews', |
| | | [ |
| | | 'render_callback' => 'jvbRenderGMBReviewsBlock' |
| | | ]); |
| | | } |
| | | // if (jvbSiteUsesFeedBlock()) { |
| | | // register_block_type( |
| | | // JVB_DIR . '/build/feed', |
| | | // [ |
| | | // 'render_callback' => 'jvbRenderFeedBlock' |
| | | // ] |
| | | // ); |
| | | // } |
| | | if (!empty(Registrar::getFeatured('show_directory'))) { |
| | | register_block_type( |
| | | JVB_DIR . '/build/list', |
| | | [ |
| | | 'render_callback' => 'jvbRenderListBlock' |
| | | ] |
| | | ); |
| | | } |
| | | register_block_type( |
| | | JVB_DIR . '/build/drawer-menu', |
| | | ); |
| | | } |
| | | |
| | | if (Site::has('is_restaurant')) { |
| | | require(JVB_DIR . '/inc/blocks/MenuBlock.php'); |
| | | new JVBase\blocks\MenuBlock(); |
| | | } |
| | | |
| | | if (Site::has('faq')) { |
| | | require(JVB_DIR . '/inc/blocks/FAQBlock.php'); |
| | | new JVBase\blocks\FAQBlock(); |
| | | } |
| | | |
| | | if (!empty(Registrar::getFeatured('is_glossary'))) { |
| | | require(JVB_DIR . '/inc/blocks/GlossaryBlock.php'); |
| | | new JVBase\blocks\GlossaryBlock(); |
| | | } |
| | | |
| | | if (!empty(Registrar::getFeatured('is_timeline'))) { |
| | | require(JVB_DIR . '/inc/blocks/TimelineBlock.php'); |
| | | new JVBase\blocks\TimelineBlock(); |
| | | } |
| | | |
| | | require(JVB_DIR . '/inc/blocks/SummaryBlock.php'); |
| | | new JVBase\blocks\SummaryBlock(); |
| | |
| | | ]); |
| | | } |
| | | add_filter('block_categories_all', 'jvbRegisterBlockCategory'); |
| | | |
| | | if (Site::hasIntegration('gmb')) { |
| | | require(JVB_DIR . '/build/gmbreviews/render.php'); |
| | | } |
| | | function jvbRegisterBlocks():void |
| | | { |
| | | if (Site::hasIntegration('gmb')) { |
| | | register_block_type( |
| | | JVB_DIR . '/build/gmbreviews', |
| | | [ |
| | | 'render_callback' => 'jvbRenderGMBReviewsBlock' |
| | | ]); |
| | | } |
| | | // if (jvbSiteUsesFeedBlock()) { |
| | | // register_block_type( |
| | | // JVB_DIR . '/build/feed', |
| | | // [ |
| | | // 'render_callback' => 'jvbRenderFeedBlock' |
| | | // ] |
| | | // ); |
| | | // } |
| | | if (!empty(Registrar::getFeatured('show_directory'))) { |
| | | register_block_type( |
| | | JVB_DIR . '/build/list', |
| | | [ |
| | | 'render_callback' => 'jvbRenderListBlock' |
| | | ] |
| | | ); |
| | | } |
| | | register_block_type( |
| | | JVB_DIR . '/build/drawer-menu', |
| | | ); |
| | | } |
| | | add_action('init', 'jvbRegisterBlocks'); |