| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\Framework\FormDesigns; |
| 4 |
|
| 5 |
use Give\Framework\FormDesigns\Contracts\FormDesignInterface; |
| 6 |
|
| 7 |
/** |
| 8 |
* The FormDesign is meant to be extended to create custom GiveWP form designs. |
| 9 |
* |
| 10 |
* @since 3.6.0 added $includeHeaderInMultiStep property |
| 11 |
* @since 3.0.0 |
| 12 |
*/ |
| 13 |
abstract class FormDesign implements FormDesignInterface |
| 14 |
{ |
| 15 |
/** |
| 16 |
* @var bool |
| 17 |
*/ |
| 18 |
protected $isMultiStep = false; |
| 19 |
/** |
| 20 |
* @var bool |
| 21 |
*/ |
| 22 |
protected $includeHeaderInMultiStep = false; |
| 23 |
|
| 24 |
/** |
| 25 |
* The unique identifier of the design |
| 26 |
* |
| 27 |
* @since 3.0.0 |
| 28 |
*/ |
| 29 |
abstract public static function id(): string; |
| 30 |
|
| 31 |
/** |
| 32 |
* THe human-readable name of the design |
| 33 |
* |
| 34 |
* @since 3.0.0 |
| 35 |
*/ |
| 36 |
abstract public static function name(): string; |
| 37 |
|
| 38 |
/** |
| 39 |
* Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory. |
| 40 |
* |
| 41 |
* @since 3.0.0 |
| 42 |
* |
| 43 |
* @return string|false |
| 44 |
*/ |
| 45 |
public function css() |
| 46 |
{ |
| 47 |
return false; |
| 48 |
} |
| 49 |
|
| 50 |
/** |
| 51 |
* Full URL of the script, or path of the script relative to the WordPress root directory. |
| 52 |
* |
| 53 |
* @since 3.0.0 |
| 54 |
* |
| 55 |
* @return string|false |
| 56 |
*/ |
| 57 |
public function js() |
| 58 |
{ |
| 59 |
return false; |
| 60 |
} |
| 61 |
|
| 62 |
/** |
| 63 |
* An array of dependencies compatible with the `$deps` parameter in wp_enqueue_script |
| 64 |
* |
| 65 |
* @see https://developer.wordpress.org/reference/functions/wp_enqueue_script/ |
| 66 |
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-dependency-extraction-webpack-plugin/#wordpress |
| 67 |
* |
| 68 |
* @return array |
| 69 |
*/ |
| 70 |
public function dependencies(): array |
| 71 |
{ |
| 72 |
return []; |
| 73 |
} |
| 74 |
|
| 75 |
/** |
| 76 |
* @since 3.0.0 |
| 77 |
*/ |
| 78 |
public function isMultiStep(): bool |
| 79 |
{ |
| 80 |
return $this->isMultiStep; |
| 81 |
} |
| 82 |
|
| 83 |
/** |
| 84 |
* @since 3.6.0 |
| 85 |
*/ |
| 86 |
public function shouldIncludeHeaderInMultiStep(): bool |
| 87 |
{ |
| 88 |
return $this->includeHeaderInMultiStep; |
| 89 |
} |
| 90 |
} |
| 91 |
|