PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 3.1.7
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v3.1.7
3.1.14 3.1.13 3.1.12 3.1.11 3.1.10 3.1.9 3.1.8 3.1.7 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 All 123 releases
firebox / Inc / Framework / Inc / Base / Fields / Textarea.php

Textarea.php in FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment 3.1.7, at Inc/Framework/Inc/Base/Fields/Textarea.php

88 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package FirePlugins Framework
4 * @version 1.1.146
5 *
6 * @author FirePlugins <[email protected]>
7 * @link https://www.fireplugins.com
8 * @copyright Copyright © 2026 FirePlugins All Rights Reserved
9 * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
10 */
11
12 namespace FPFramework\Base\Fields;
13
14 if (!defined('ABSPATH'))
15 {
16 exit; // Exit if accessed directly.
17 }
18
19 use FPFramework\Base\Field;
20 use FPFramework\Libs\Registry;
21
22 class Textarea extends Field
23 {
24 /**
25 * Set specific field options
26 *
27 * @param array $options
28 *
29 * @return void
30 */
31 protected function setFieldOptions($options)
32 {
33 $options = new Registry($options);
34
35 $this->field_options = [
36 'mode' => $options->get('mode', null),
37 'rows' => $options->get('rows'),
38 'filter' => $options->get('filter', 'textarea')
39 ];
40 }
41
42 /**
43 * Runs before field renders.
44 *
45 * @return void
46 */
47 public function onBeforeRender()
48 {
49 // Run only if a textarea mode is given
50 if (!$mode = $this->options['mode'])
51 {
52 return;
53 }
54
55 $mode = 'text/html';
56
57 if ($mode == 'php')
58 {
59 $mode = 'application/x-httpd-php';
60 }
61 else if ($mode == 'javascript')
62 {
63 $mode = 'text/javascript';
64 }
65 else if ($mode == 'css')
66 {
67 $mode = 'text/css';
68 }
69
70 // load code editor
71 $settings = wp_enqueue_code_editor([ 'type' => 'text/html' ]);
72
73 // Bail if user disabled CodeMirror
74 if ( false === $settings ) {
75 return;
76 }
77
78 // JS
79 wp_register_script(
80 'fpframework-textarea-field',
81 FPF_MEDIA_URL . 'admin/js/fpf_textarea.js',
82 [],
83 FPF_VERSION,
84 false
85 );
86 wp_enqueue_script('fpframework-textarea-field');
87 }
88 }