| 1 |
<?php |
| 2 |
/** |
| 3 |
* Block Interface |
| 4 |
* |
| 5 |
* @package PRAD |
| 6 |
* @since 1.0.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace PRAD\Includes\Blocks\Interfaces; |
| 10 |
|
| 11 |
defined( 'ABSPATH' ) || exit; |
| 12 |
|
| 13 |
/** |
| 14 |
* Block Interface - All blocks must implement this |
| 15 |
*/ |
| 16 |
interface Block_Interface { |
| 17 |
|
| 18 |
/** |
| 19 |
* Render the block HTML |
| 20 |
* |
| 21 |
* @return string |
| 22 |
*/ |
| 23 |
public function render(): string; |
| 24 |
|
| 25 |
/** |
| 26 |
* Get the block type identifier |
| 27 |
* |
| 28 |
* @return string |
| 29 |
*/ |
| 30 |
public function get_type(): string; |
| 31 |
|
| 32 |
/** |
| 33 |
* Validate block data and state |
| 34 |
* |
| 35 |
* @return bool |
| 36 |
*/ |
| 37 |
public function validate(): bool; |
| 38 |
|
| 39 |
/** |
| 40 |
* Get the price value for this block |
| 41 |
* |
| 42 |
* @return float |
| 43 |
*/ |
| 44 |
public function get_price(): float; |
| 45 |
|
| 46 |
/** |
| 47 |
* Get block configuration data |
| 48 |
* |
| 49 |
* @return array |
| 50 |
*/ |
| 51 |
public function get_config(): array; |
| 52 |
|
| 53 |
/** |
| 54 |
* Check if block should be displayed |
| 55 |
* |
| 56 |
* @return bool |
| 57 |
*/ |
| 58 |
public function should_display(): bool; |
| 59 |
} |
| 60 |
|