| | |
| | | } |
| | | |
| | | use JVBase\registrar\Registrar; |
| | | use JVBase\base\Site; |
| | | use WP_Block; |
| | | use WP_Query; |
| | | |
| | |
| | | |
| | | jvb_register_do_once('buildDirectories', [$this, 'activate']); |
| | | add_action('init', [$this, 'registerDirectories']); |
| | | add_action('render_block', [$this, 'renderBlock'], 99999, 3); |
| | | add_action('render_block', [$this, 'renderBlock'], 998, 3); |
| | | } |
| | | |
| | | public function registerDirectories():void |
| | |
| | | } |
| | | } |
| | | |
| | | // if (Features::forSite()->has('has_map')) { |
| | | // if (Site::has('has_map')) { |
| | | // $ID = wp_insert_post([ |
| | | // 'post_type' => BASE.'directory', |
| | | // 'post_title' => 'Map', |
| | |
| | | return $content; |
| | | } |
| | | |
| | | error_log('Still working on directory manager...'); |
| | | // For archive page |
| | | if (is_post_type_archive(BASE.'directory') && $block['blockName'] === 'core/group') { |
| | | return ($block['attrs']['tagName']??'' === 'main') ? '<main>'.$this->renderArchive().'</main>' : $content; |