PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 2.2.10
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v2.2.10
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
← All changes | admin/views/sp-framework/fields/tabbed/tabbed.php +39 -67 4.0.8 → 2.2.10 View file →
@@ -1,92 +1,64 @@
1 -<?php
1 +<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2 2 /**
3 - * Framework Tabbed fields.
4 3 *
5 - * @link https://shapedplugin.com/
6 - *
7 - * @package Smart_Post_Show
8 - * @subpackage Smart_Post_Show/admin/views
9 - */
10 -
11 -if ( ! defined( 'ABSPATH' ) ) {
12 - die;
13 -} // Cannot access directly.
14 -
15 -/**
16 - *
17 4 * Field: tabbed
18 5 *
19 6 * @since 1.0.0
20 7 * @version 1.0.0
8 + *
21 9 */
22 -if ( ! class_exists( 'SP_PC_Field_tabbed' ) ) {
10 +if( ! class_exists( 'SP_PC_Field_tabbed' ) ) {
11 + class SP_PC_Field_tabbed extends SP_PC_Fields {
23 12
24 - /**
25 - * SP_PC_Field_tabbed
26 - */
27 - class SP_PC_Field_tabbed extends SP_PC_Fields {
13 + public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14 + parent::__construct( $field, $value, $unique, $where, $parent );
15 + }
28 16
29 - /**
30 - * Field constructor.
31 - *
32 - * @param array $field The field type.
33 - * @param string $value The values of the field.
34 - * @param string $unique The unique ID for the field.
35 - * @param string $where To where show the output CSS.
36 - * @param string $parent The parent args.
37 - */
38 - public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
39 - parent::__construct( $field, $value, $unique, $where, $parent );
40 - }
17 + public function render() {
41 18
42 - /**
43 - * Render field
44 - *
45 - * @return void
46 - */
47 - public function render() {
19 + $unallows = array( 'tabbed' );
48 20
49 - $unallows = array( 'tabbed' );
21 + echo $this->field_before();
50 22
51 - echo wp_kses_post( $this->field_before() );
23 + echo '<div class="spf-tabbed-nav">';
24 + foreach ( $this->field['tabs'] as $key => $tab ) {
52 25
53 - echo '<div class="spf-tabbed-nav">';
54 - foreach ( $this->field['tabs'] as $key => $tab ) {
26 + $tabbed_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="spf--icon '. $tab['icon'] .'"></i>' : '';
27 + $tabbed_active = ( empty( $key ) ) ? ' class="spf-tabbed-active"' : '';
55 28
56 - $tabbed_icon = ( ! empty( $tab['icon'] ) ) ? $tab['icon'] : '';
57 - $tabbed_class = ( ! empty( $tab['class'] ) ) ? $tab['class'] : '';
58 - $tabbed_active = ( empty( $key ) ) ? ' spf-tabbed-active' : '';
29 + echo '<a href="#"'. $tabbed_active .'>'. $tabbed_icon . $tab['title'] .'</a>';
59 30
60 - echo '<a href="#" class="' . esc_attr( $tabbed_class . $tabbed_active ) . '" >' . wp_kses_post( $tabbed_icon . $tab['title'] ) . '</a>';
31 + }
32 + echo '</div>';
61 33
62 - }
63 - echo '</div>';
34 + echo '<div class="spf-tabbed-sections">';
35 + foreach ( $this->field['tabs'] as $key => $tab ) {
64 36
65 - echo '<div class="spf-tabbed-sections">';
66 - foreach ( $this->field['tabs'] as $key => $tab ) {
37 + $tabbed_hidden = ( ! empty( $key ) ) ? ' hidden' : '';
67 38
68 - $tabbed_hidden = ( ! empty( $key ) ) ? ' hidden' : '';
69 - $tabbed_class = ( ! empty( $tab['class'] ) ) ? ' ' . $tab['class'] : '';
70 - echo '<div class="spf-tabbed-section' . esc_attr( $tabbed_hidden . $tabbed_class ) . '">';
39 + echo '<div class="spf-tabbed-section'. $tabbed_hidden .'">';
71 40
72 - foreach ( $tab['fields'] as $field ) {
73 - if ( in_array( $field['type'], $unallows ) ) {
74 - $field['_notice'] = true; }
75 - $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
76 - $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
77 - $field_value = ( isset( $this->value[ $field_id ] ) ) ? $this->value[ $field_id ] : $field_default;
78 - $unique_id = ( ! empty( $this->unique ) ) ? $this->unique : '';
41 + foreach ( $tab['fields'] as $field ) {
79 42
80 - SP_PC::field( $field, $field_value, $unique_id, 'field/tabbed' );
43 + if( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
81 44
82 - }
45 + $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
46 + $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
47 + $field_value = ( isset( $this->value[$field_id] ) ) ? $this->value[$field_id] : $field_default;
48 + $unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']' : $this->field['id'];
83 49
84 - echo '</div>';
50 + SP_PC::field( $field, $field_value, $unique_id, 'field/tabbed' );
85 51
86 - }
87 - echo '</div>';
52 + }
88 53
89 - echo wp_kses_post( $this->field_after() );
90 - }
91 - }
54 + echo '</div>';
55 +
56 + }
57 + echo '</div>';
58 +
59 + echo $this->field_after();
60 +
61 + }
62 +
63 + }
92 64 }