| | |
| | | { |
| | | $this->cache = Cache::for('blocks', WEEK_IN_SECONDS); |
| | | $this->cache->connect('post')->connect('taxonomy'); |
| | | add_filter('render_block', [$this, 'render'], 990, 3); |
| | | add_filter('render_block', [$this, 'render'], 900, 3); |
| | | |
| | | add_action('init', [$this, 'registerBlockStyles']); |
| | | } |
| | |
| | | 'main'; |
| | | |
| | | if ($content == '') { |
| | | global $post; |
| | | if(is_singular()) { |
| | | global $post; |
| | | |
| | | $block['innerBlocks'] = parse_blocks($post->post_content); |
| | | $result = $this->innerBlocks($block); |
| | | $block['innerBlocks'] = parse_blocks($post->post_content); |
| | | $result = $this->innerBlocks($block); |
| | | }else { |
| | | $result = ''; |
| | | } |
| | | } else { |
| | | $result = $this->inside($block, $tag, $content); |
| | | } |