PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.4.26
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.4.26
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 / section_tab / section_tab.php

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

69 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' ) ) { die; } // Cannot access directly.
6 /**
7 *
8 * Field: section_tab
9 *
10 * @since 1.0.0
11 * @version 1.0.0
12 *
13 */
14
15 if ( ! class_exists( 'DarkifyField_section_tab' ) ) {
16 class DarkifyField_section_tab extends DarkifyFields {
17
18 public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
19 parent::__construct( $field, $value, $unique, $where, $parent );
20 }
21
22 public function render() {
23
24 $unallows = array( 'section_tab' );
25
26 echo wp_kses_post($this->field_before());
27
28 echo '<div class="darkify-section_tab-nav">';
29 foreach ( $this->field['tabs'] as $key => $tab ) {
30 $section_tab_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="darkify--icon '. esc_attr( $tab['icon'] ) .'"></i>' : '';
31 $section_tab_active = ( empty( $key ) ) ? 'darkify-section_tab-active' : '';
32
33 echo '<a href="#" class="'. esc_attr( $section_tab_active ) .'">'. wp_kses_post($section_tab_icon) . esc_attr( $tab['title'] ) .'</a>';
34
35 }
36 echo '</div>';
37
38 echo '<div class="darkify-section_tab-sections">';
39 foreach ( $this->field['tabs'] as $key => $tab ) {
40
41 $section_tab_hidden = ( ! empty( $key ) ) ? ' hidden' : '';
42
43 echo '<div class="darkify-section_tab-content'. esc_attr( $section_tab_hidden ) .'">';
44
45 foreach ( $tab['fields'] as $field ) {
46
47 if ( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
48
49 $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
50 $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
51 $field_value = ( isset( $this->value[$field_id] ) ) ? $this->value[$field_id] : $field_default;
52 $unique_id = ( ! empty( $this->unique ) ) ? $this->unique : '';
53
54 Darkify::field( $field, $field_value, $unique_id, 'field/section_tab' );
55
56 }
57
58 echo '</div>';
59
60 }
61 echo '</div>';
62
63 echo wp_kses_post($this->field_after());
64
65 }
66
67 }
68 }
69