PluginProbe ʕ •ᴥ•ʔ
YITH WooCommerce Wishlist / 3.0.17
YITH WooCommerce Wishlist v3.0.17
4.16.0 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.17 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.18 3.0.19 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.25 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.10.0 3.11.0 3.12.0 3.13.0 3.14.0 3.15.0 3.16.0 3.17.0 3.18.0 3.19.0 3.2.0 3.20.0 3.21.0 3.22.0 3.23.0 3.24.0 3.25.0 3.26.0 3.27.0 3.28.0 3.29.0 3.3.0 3.30.0 3.31.0 3.32.0 3.33.0 3.34.0 3.35.0 3.36.0 3.37.0 3.38.0 3.4.0 3.5.0 3.6.0 3.7.0 3.8.0 3.9.0 4.0.0 4.0.1 4.1.0 4.10.0 4.10.1 4.10.2 4.11.0 4.12.0 4.13.0 4.14.0 4.15.0 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.8.0 4.9.0
yith-woocommerce-wishlist / plugin-fw / templates / metaboxes / tab.php
yith-woocommerce-wishlist / plugin-fw / templates / metaboxes Last commit date
types 7 years ago field-row.php 6 years ago tab.php 5 years ago
tab.php
117 lines
1 <?php
2 /**
3 * This file belongs to the YIT Plugin Framework.
4 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5 * that is bundled with this package in the file LICENSE.txt.
6 * It is also available through the world-wide-web at this URL:
7 * http://www.gnu.org/licenses/gpl-3.0.txt
8 *
9 * @var array $tabs
10 * @var string $class
11 */
12
13 if ( !defined( 'ABSPATH' ) ) {
14 exit;
15 } // Exit if accessed directly
16
17 global $post;
18 $classes = apply_filters( 'yith_plugin_fw_metabox_class', $class, $post );
19 $classes = yith_plugin_fw_remove_duplicate_classes( $classes );
20
21 do_action( 'yit_before_metaboxes_tab' ) ?>
22 <div class="yith-plugin-fw metaboxes-tab <?php echo esc_attr( $classes ) ?>">
23 <?php do_action( 'yit_before_metaboxes_labels' ) ?>
24 <ul class="metaboxes-tabs clearfix"<?php if ( count( $tabs ) <= 1 ) : ?> style="display:none;"<?php endif; ?>>
25 <?php
26 $i = 0;
27 foreach ( $tabs as $key => $tab ) :
28 if ( !isset( $tab[ 'fields' ] ) || empty( $tab[ 'fields' ] ) ) {
29 continue;
30 }
31 $anchor_id = 'yith-plugin-fw-metabox-tab-' . urldecode( $key ) . '-anchor';
32
33 // parse deps for the tab visibility
34 if ( isset( $tab[ 'deps' ] ) ) {
35 $tab[ 'deps' ][ 'target-id' ] = isset( $tab[ 'deps' ][ 'target-id' ] ) ? $tab[ 'deps' ][ 'target-id' ] : $anchor_id;
36 if ( isset( $tab[ 'deps' ][ 'id' ] ) && strpos( $tab[ 'deps' ][ 'id' ], '_' ) !== 0 )
37 $tab[ 'deps' ][ 'id' ] = '_' . $tab[ 'deps' ][ 'id' ];
38 if ( isset( $tab[ 'deps' ][ 'ids' ] ) && strpos( $tab[ 'deps' ][ 'ids' ], '_' ) !== 0 )
39 $tab[ 'deps' ][ 'ids' ] = '_' . $tab[ 'deps' ][ 'ids' ];
40
41 $tab[ 'deps' ][ 'type' ] = 'hideme';
42 }
43 ?>
44 <li id="<?php echo $anchor_id ?>" <?php if ( !$i ) : ?>class="tabs"<?php endif ?> <?php echo yith_field_deps_data( $tab ); ?>>
45 <a href="#<?php echo urldecode( $key ) ?>"><?php echo $tab[ 'label' ] ?></a></li><?php
46 $i++;
47 endforeach;
48 ?>
49 </ul>
50 <?php do_action( 'yit_after_metaboxes_labels' ) ?>
51 <?php if ( isset( $tab[ 'label' ] ) ) : ?>
52 <?php do_action( 'yit_before_metabox_option_' . urldecode( $key ) ); ?>
53 <?php endif ?>
54
55 <?php
56 // Use nonce for verification
57 wp_nonce_field( 'metaboxes-fields-nonce', 'yit_metaboxes_nonce' );
58 ?>
59 <?php foreach ( $tabs as $key => $tab ) :
60
61 ?>
62 <div class="tabs-panel" id="<?php echo urldecode( $key ) ?>">
63 <?php
64 if ( !isset( $tab[ 'fields' ] ) ) {
65 continue;
66 }
67
68 $tab[ 'fields' ] = apply_filters( 'yit_metabox_' . $key . '_tab_fields', $tab[ 'fields' ] );
69
70 foreach ( $tab[ 'fields' ] as $id_tab => $field ) :
71 $field_name = $field[ 'name' ];
72 $field_name = str_replace( 'yit_metaboxes[', '', $field_name );
73 if ( $pos = strpos( $field_name, ']' ) ) {
74 $field_name = substr_replace( $field_name, '', $pos, 1 );
75 }
76 $value = yit_get_post_meta( $post->ID, $field_name );
77 $field['value'] = false === $value ? ( isset( $field['std'] ) ? $field['std'] : '' ) : $value;
78 $field['checkboxgroup'] = ( $field['type'] == 'checkbox' && isset( $field['checkboxgroup'] ) ) ? " " . $field['checkboxgroup'] : "";
79 $container_classes = "the-metabox " . $field['type'] . $field['checkboxgroup'] . " clearfix ";
80 $container_classes .= empty( $field['label'] ) ? 'no-label' : '';
81
82 ?>
83 <div class="<?php echo $container_classes ?>">
84 <?php
85 if ( $field_template_path = yith_plugin_fw_get_field_template_path( $field ) ) {
86 $display_row = 'hidden' !== $field[ 'type' ];
87 $display_row = isset( $field[ 'yith-display-row' ] ) ? !!$field[ 'yith-display-row' ] : $display_row;
88 $field[ 'display-field-only' ] = in_array( $field[ 'type' ], array( 'hidden', 'html', 'sep', 'simple-text', 'title', 'list-table' ) );
89
90 if ( $display_row ) {
91
92 $field_row_path = apply_filters( 'yith_plugin_fw_metabox_field_row_template_path', YIT_CORE_PLUGIN_TEMPLATE_PATH . '/metaboxes/field-row.php', $field );
93 file_exists( $field_row_path ) && include( $field_row_path );
94 } else {
95
96 yith_plugin_fw_get_field( $field, true );
97 }
98 } else {
99 // backward compatibility
100 $args = apply_filters( 'yit_fw_metaboxes_type_args', array(
101 'basename' => YIT_CORE_PLUGIN_PATH,
102 'path' => '/metaboxes/types/',
103 'type' => $field[ 'type' ],
104 'args' => array( 'args' => $field )
105 )
106 );
107 extract( $args );
108 yit_plugin_get_template( $basename, $path . $type . '.php', $args );
109 }
110 ?>
111 </div>
112 <?php endforeach ?>
113 </div>
114 <?php endforeach ?>
115 </div>
116
117 <?php do_action( 'yit_after_metaboxes_tab' );