IconPicker.php
5 years ago
Input.php
5 years ago
Select.php
5 years ago
Textarea.php
5 years ago
WPEditor.php
5 years ago
WPEditor.php
33 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePress\Core\Admin\SettingsPages\DragDropBuilder\Controls; |
| 4 | |
| 5 | |
| 6 | class WPEditor |
| 7 | { |
| 8 | public $args; |
| 9 | |
| 10 | public function __construct($args) |
| 11 | { |
| 12 | $this->args = wp_parse_args( |
| 13 | $args, |
| 14 | ['name' => '', 'value' => sprintf('{{{data.%s}}}', $args['name'])] |
| 15 | ); |
| 16 | } |
| 17 | |
| 18 | public function render() |
| 19 | { |
| 20 | echo sprintf('<label for="%s" class="pp-label">%s</label>', $this->args['name'], $this->args['label']); |
| 21 | |
| 22 | if (isset($this->args['description'])) { |
| 23 | printf('<div class="pp-form-control-description">%s</div>', $this->args['description']); |
| 24 | } |
| 25 | |
| 26 | echo sprintf( |
| 27 | '<textarea style="height: 300px;padding: 10px;width: 100%" placeholder="%3$s" id="%1$s" name="%1$s" class="pp-form-control pp-form-control-wpeditor">%2$s</textarea>', |
| 28 | $this->args['name'], |
| 29 | @$this->args['value'], |
| 30 | @$this->args['placeholder'] |
| 31 | ); |
| 32 | } |
| 33 | } |