PluginProbe ʕ •ᴥ•ʔ
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.1
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.1
2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 0.0.8 0.0.9 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.1.0 1.1.1 1.1.2 1.10.0 1.10.1 1.11.0 1.12.0 1.12.1 1.12.2 1.12.3 1.13.0 1.13.1 1.13.2 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.2 2.6.0
sureforms / inc / blocks / base.php
sureforms / inc / blocks Last commit date
address 4 months ago checkbox 4 months ago dropdown 2 months ago email 4 months ago gdpr 4 months ago inlinebutton 4 months ago input 1 month ago multichoice 2 months ago number 4 months ago payment 2 months ago payment-history 3 months ago phone 4 months ago sform 3 months ago textarea 2 months ago url 4 months ago base.php 1 year ago register.php 1 year ago
base.php
73 lines
1 <?php
2 /**
3 * The blocks base file.
4 *
5 * @link https://sureforms.com
6 * @since 0.0.1
7 * @package SureForms
8 * @author SureForms <https://sureforms.com/>
9 */
10
11 namespace SRFM\Inc\Blocks;
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit; // Exit if accessed directly.
15 }
16
17 /**
18 * Block base class.
19 */
20 abstract class Base {
21 /**
22 * Optional directory to .json block data files.
23 *
24 * @var string
25 * @since 0.0.1
26 */
27 protected $directory = '';
28
29 /**
30 * Register the block for dynamic output
31 *
32 * @return void
33 * @since 0.0.1
34 */
35 public function register() {
36 register_block_type_from_metadata(
37 $this->get_dir(),
38 apply_filters(
39 'srfm_block_registration_args',
40 [ 'render_callback' => [ $this, 'render' ] ]
41 )
42 );
43 }
44
45 /**
46 * Get the called class directory path
47 *
48 * @return string
49 * @since 0.0.1
50 */
51 public function get_dir() {
52 if ( $this->directory ) {
53 return $this->directory;
54 }
55
56 $reflector = new \ReflectionClass( $this );
57 $fn = (string) $reflector->getFileName();
58 return dirname( $fn );
59 }
60
61 /**
62 * Render the block
63 *
64 * @param array<mixed> $attributes Block attributes.
65 *
66 * @return string
67 * @since 0.0.1
68 */
69 public function render( $attributes ) {
70 return '';
71 }
72 }
73