PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.13.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.13.0
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
ablocks / includes / blocks / modal-panel / block.php

block.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.13.0, at includes/blocks/modal-panel/block.php

39 lines 992 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ABlocks\Blocks\ModalPanel;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 use ABlocks\Classes\BlockBaseAbstract;
10 use ABlocks\Classes\CssGenerator;
11
12 class Block extends BlockBaseAbstract {
13 protected $parent_block_name = 'modal';
14 protected $block_name = 'modal-panel';
15
16 public function __construct() {
17 parent::__construct();
18 add_filter( 'ablocks/get_render_block_content', [ $this, 'render_static_block_content' ], 10, 3 );
19 }
20
21 public function build_css( $attributes ) {
22 $css_generator = new CssGenerator( $attributes );
23 return $css_generator->generate_css();
24 }
25
26 public function render_static_block_content( $content, $attributes, $block_instance ) {
27 if ( $block_instance->name === $this->namespace . '/' . $this->block_name ) {
28 return preg_replace(
29 '/<div\s+class="ablocks-block-modal---panel-wrap"(?![^>]*style=)/i',
30 '<div class="ablocks-block-modal---panel-wrap" style="opacity:0;visibility:hidden;"',
31 $content
32 );
33 }
34 return $content;
35 }
36
37
38 }
39