PluginProbe
Enter Addons – Ultimate Template Builder for Elementor / trunk
Enter Addons – Ultimate Template Builder for Elementor vtrunk
trunk 2.2.10 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4
enteraddons / core / settingsfields / Textarea.php

Textarea.php in Enter Addons – Ultimate Template Builder for Elementor trunk, at core/settingsfields/Textarea.php

76 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Enteraddons\Core;
3 /**
4 * Enteraddons Post Type Meta class
5 *
6 * @package EnterAddons Pro
7 * @author ThemeLooks
8 * @copyright 2022 ThemeLooks
9 * @license GPL-2.0-or-later
10 *
11 *
12 */
13
14 trait Textarea {
15
16 protected static $args;
17
18 protected static $type = '';
19
20 public function textarea_meta( $args ) {
21 self::$type = 'meta';
22 $this->textarea( $args );
23 }
24
25 public function textarea( $args ) {
26
27 $default = [
28 'title' => '',
29 'name' => '',
30 'description' => '',
31 'class' => '',
32 'condition' => ''
33 ];
34
35 self::$args = wp_parse_args( $args, $default );
36 self::textarea_markup();
37 }
38
39 protected static function textarea_markup() {
40
41 $args = self::$args;
42 $uniqName = $args['name'];
43
44 if( self::$type != 'meta' ) {
45 $wrapTypeClass = '';
46 $optionName = self::$optionName;
47 $getData = self::$getOptionData;
48 $fieldName = esc_attr( $optionName ).'['.$uniqName.']';
49 $value = !empty( $getData[$uniqName] ) ? $getData[$uniqName] : '';
50
51 } else {
52 $wrapTypeClass = 'ea-meta-field ';
53 $fieldName = $uniqName;
54 $value = get_post_meta( get_the_ID(), $uniqName, true );
55 }
56
57 $conditionData = '';
58 if( !empty( $args['condition'] ) ) {
59 $conditionData = wp_json_encode( $args['condition'] );
60 }
61 ?>
62 <div class="eap-admin-field" data-condition="<?php echo esc_html($conditionData); ?>">
63 <h4><?php echo esc_html( $args['title'] ); ?></h4>
64 <div class="fb-field-group">
65 <textarea name="<?php echo esc_attr( $fieldName ); ?>" ><?php echo esc_attr( $value ); ?></textarea>
66 <?php
67 if( !empty( $args['description'] ) ) {
68 echo '<p>'.esc_html( $args['description'] ).'</p>';
69 }
70 ?>
71 </div>
72 </div>
73 <?php
74 }
75 }
76