PluginProbe
SureDonation – Donation Forms, Fundraising Campaigns & Donor Management / 1.2.0
SureDonation – Donation Forms, Fundraising Campaigns & Donor Management v1.2.0
1.6.0 1.5.1 1.5.0 1.4.0 1.3.0 trunk 0.0.1 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0
suredonation / inc / blocks / address / block.php

block.php in SureDonation – Donation Forms, Fundraising Campaigns & Donor Management 1.2.0, at inc/blocks/address/block.php

47 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * PHP render for Address Block.
4 *
5 * @package SureDonation
6 * @since 1.1.1
7 */
8
9 namespace SureDonation\Inc\Blocks\Address;
10
11 use SureDonation\Inc\Blocks\Base;
12 use SureDonation\Inc\Fields\Address_Markup;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit; // Exit if accessed directly.
16 }
17
18 /**
19 * Address Block.
20 *
21 * @since 1.1.1
22 */
23 class Block extends Base {
24 /**
25 * Render the block.
26 *
27 * The address block is a container: $content holds the already-rendered inner
28 * sub-fields (input + dropdown blocks). We only wrap them in the fieldset.
29 *
30 * @param array<string, mixed> $attributes Block attributes.
31 * @param string $content Rendered inner block content.
32 * @return string
33 * @since 1.1.1
34 */
35 public function render( $attributes, $content = '' ) {
36 if ( empty( $attributes ) ) {
37 return $content;
38 }
39
40 $markup_class = new Address_Markup( $attributes );
41 ob_start();
42 echo wp_kses( $markup_class->markup( $content ), self::get_allowed_form_html() );
43 $output = ob_get_clean();
44 return false !== $output ? $output : '';
45 }
46 }
47