PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.4.6
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.4.6
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 / src / Admin / Framework / fields / tabbed / tabbed.php

tabbed.php in Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) 1.4.6, at src/Admin/Framework/fields/tabbed/tabbed.php

68 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use ThemeAtelier\Darkify\Admin\Framework\Classes\Darkify;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 die; } // Cannot access directly.
7 /**
8 *
9 * Field: tabbed
10 *
11 * @since 1.0.0
12 * @version 1.0.0
13 */
14 if ( ! class_exists( 'DarkifyField_tabbed' ) ) {
15 class DarkifyField_tabbed extends DarkifyFields {
16
17 public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
18 parent::__construct( $field, $value, $unique, $where, $parent );
19 }
20
21 public function render() {
22
23 $unallows = array( 'tabbed' );
24
25 echo wp_kses_post( $this->field_before() );
26
27 echo '<div class="darkify-tabbed-nav" data-depend-id="' . esc_attr( $this->field['id'] ) . '">';
28 foreach ( $this->field['tabs'] as $key => $tab ) {
29
30 $tabbed_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="darkify--icon ' . esc_attr( $tab['icon'] ) . '"></i>' : '';
31 $tabbed_active = ( empty( $key ) ) ? 'darkify-tabbed-active' : '';
32
33 echo '<a href="#" class="' . esc_attr( $tabbed_active ) . '"">' . wp_kses_post($tabbed_icon) . esc_attr( $tab['title'] ) . '</a>';
34
35 }
36 echo '</div>';
37
38 echo '<div class="darkify-tabbed-contents">';
39 foreach ( $this->field['tabs'] as $key => $tab ) {
40
41 $tabbed_hidden = ( ! empty( $key ) ) ? ' hidden' : '';
42
43 echo '<div class="darkify-tabbed-content' . esc_attr( $tabbed_hidden ) . '">';
44
45 foreach ( $tab['fields'] as $field ) {
46
47 if ( in_array( $field['type'], $unallows ) ) {
48 $field['_notice'] = true; }
49
50 $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
51 $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
52 $field_value = ( isset( $this->value[ $field_id ] ) ) ? $this->value[ $field_id ] : $field_default;
53 $unique_id = ( ! empty( $this->unique ) ) ? $this->unique . '[' . $this->field['id'] . ']' : $this->field['id'];
54
55 Darkify::field( $field, $field_value, $unique_id, 'field/tabbed' );
56
57 }
58
59 echo '</div>';
60
61 }
62 echo '</div>';
63
64 echo wp_kses_post( $this->field_after() );
65 }
66 }
67 }
68