PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.2.4
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.2.4
2.1.3 2.1.2 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 trunk 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 All 57 releases
darkify / admin / ta-framework / fields / textarea / textarea.php

textarea.php in Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) 1.2.4, at admin/ta-framework/fields/textarea/textarea.php

53 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) {
2 die; } // Cannot access directly.
3 /**
4 *
5 * Field: textarea
6 *
7 * @since 1.0.0
8 * @version 1.0.0
9 */
10 if ( ! class_exists( 'DRK_LITE_Field_textarea' ) ) {
11 class DRK_LITE_Field_textarea extends DRK_LITE_Fields {
12
13 public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14 parent::__construct( $field, $value, $unique, $where, $parent );
15 }
16
17 public function render() {
18
19 echo wp_kses_post( $this->field_before() );
20 echo esc_html( $this->shortcoder() );
21 echo '<textarea name="' . esc_attr( $this->field_name() ) . '"' . wp_kses_post( $this->field_attributes() ) . '>' . wp_kses_post($this->value) . '</textarea>';
22 echo wp_kses_post( $this->field_after() );
23 }
24
25 public function shortcoder() {
26
27 if ( ! empty( $this->field['shortcoder'] ) ) {
28
29 $shortcodes = ( is_array( $this->field['shortcoder'] ) ) ? $this->field['shortcoder'] : array_filter( (array) $this->field['shortcoder'] );
30 $instances = ( ! empty( DRK_LITE::$shortcode_instances ) ) ? DRK_LITE::$shortcode_instances : array();
31
32 if ( ! empty( $shortcodes ) && ! empty( $instances ) ) {
33
34 foreach ( $shortcodes as $shortcode ) {
35
36 foreach ( $instances as $instance ) {
37
38 if ( $instance['modal_id'] === $shortcode ) {
39
40 $id = $instance['modal_id'];
41 $title = $instance['button_title'];
42
43 echo '<a href="#" class="button button-primary drk_lite-shortcode-button" data-modal-id="' . esc_attr( $id ) . '">' . esc_html( $title ) . '</a>';
44
45 }
46 }
47 }
48 }
49 }
50 }
51 }
52 }
53