| 1 |
<?php |
| 2 |
/** |
| 3 |
* PHP render form Inline Button Block. |
| 4 |
* |
| 5 |
* @package SureForms. |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace SRFM\Inc\Blocks\Inlinebutton; |
| 9 |
|
| 10 |
use SRFM\Inc\Blocks\Base; |
| 11 |
use SRFM\Inc\Fields\Inlinebutton_Markup; |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; // Exit if accessed directly. |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* Inline Button Block. |
| 19 |
*/ |
| 20 |
class Block extends Base { |
| 21 |
|
| 22 |
/** |
| 23 |
* Render the block |
| 24 |
* |
| 25 |
* @param array<mixed> $attributes Block attributes. |
| 26 |
* @param string $content Post content. |
| 27 |
* |
| 28 |
* @return string|boolean |
| 29 |
* @since 0.0.2 |
| 30 |
*/ |
| 31 |
public function render( $attributes, $content = '' ) { |
| 32 |
|
| 33 |
if ( ! empty( $attributes ) ) { |
| 34 |
$markup_class = new Inlinebutton_Markup( $attributes ); |
| 35 |
ob_start(); |
| 36 |
// phpcs:ignore. |
| 37 |
echo $markup_class->markup(); |
| 38 |
} |
| 39 |
return ob_get_clean(); |
| 40 |
} |
| 41 |
} |
| 42 |
|