PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
wpdirectorykit / application / views / fields_edit / DROPDOWN_PAGE.php

DROPDOWN_PAGE.php in WP Directory Kit 1.5.9, at application/views/fields_edit/DROPDOWN_PAGE.php

100 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Edit field DROPDOWN PAGE.
4 *
5 * This is the template that field layout for edit form, pages list
6 *
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12 ?>
13 <?php
14
15 if(isset($field->field))
16 {
17 $field_id = $field->field;
18 }
19 else
20 {
21 $field_id = 'field_'.$field->idfield;
22 }
23
24 if(!isset($field->hint))$field->hint = '';
25
26 $field_label = $field->field_label;
27
28 if(!isset($field->hint))$field->hint = '';
29 if(!isset($field->class))$field->class = '';
30 if(!isset($field->columns_number))$field->columns_number = '';
31 if(!isset($field->prefix))$field->prefix = '';
32 if(!isset($field->suffix))$field->suffix = '';
33
34 $required = '';
35 if(isset($field->is_required) && $field->is_required == 1)
36 $required = '*';
37
38 if(!empty($field->values) && is_array($field->values)){
39 $values = $field->values;
40 } else {
41 $values = array();
42 if(!empty($field->values_list)){
43 $values = explode(',', $field->values_list);
44 $values = array(''=> __('Not Selected', 'wpdirectorykit')) + array_combine($values, $values);
45 }
46 }
47
48 $button_suffix = '';
49
50 ?>
51
52 <div class="wdk-field-<?php echo esc_attr($field_id);?> wdk-field-edit <?php echo esc_attr($field->field_type); ?> wdk-col-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->class); ?>">
53 <label for="<?php echo esc_attr($field_id); ?>"><?php echo esc_html($field_label).esc_html($required); ?></label>
54 <div class="wdk-field-container">
55 <?php
56 echo wp_kses(
57 wmvc_select_option($field_id, $values, wmvc_show_data($field_id, $db_data, '')),
58 [
59 'select' => [
60 'id' => true,
61 'name' => true,
62 ],
63 'option' => [
64 'value' => true,
65 'selected' => true,
66 ],
67 ]
68 );
69 ?>
70
71 <span class="suffix"><?php
72 // Dynamic field values are registered in the translation catalog separately.
73 // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
74 echo esc_html__($field->prefix, 'wpdirectorykit');
75 if(!empty($field->prefix) && !empty($field->suffix)) echo ' / ';
76 // Dynamic field values are registered in the translation catalog separately.
77 // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
78 echo esc_html__($field->suffix, 'wpdirectorykit');
79 ?>
80 <?php if(!empty(wmvc_show_data($field_id, $db_data, '')) && get_post_status(wmvc_show_data($field_id, $db_data, '')) == 'publish'):?>
81 <a class="button button-primary" target="_blank" href="<?php echo esc_url(get_permalink(wmvc_show_data($field_id, $db_data, '')));?>" style="margin-top: -5px;">
82 <?php echo esc_html__('View Page','wpdirectorykit');?>
83 </a>
84 <a class="button button" target="_blank" href="<?php echo esc_url(admin_url('post.php?post='.wmvc_show_data($field_id, $db_data, '')).'&action=edit');?>" style="margin-top: -5px;">
85 <span class="dashicons dashicons-edit"></span>
86 </a>
87 <?php else:?>
88 <?php if(isset($_GET['page']) && $_GET['page'] == 'wpdirectorykit'):?>
89 <a class="button button-primary" target="_blank" href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk-membership&function=import_demo"); ?>" style="margin-top: -5px;">
90 <?php echo esc_html__('Create Demo Page','wpdirectorykit');?>
91 </a>
92 <?php endif;?>
93 <?php endif;?></span>
94 <?php if(!empty($field->hint)):?>
95 <p class="wdk-hint">
96 <?php echo esc_html($field->hint); ?>
97 </p>
98 <?php endif;?>
99 </div>
100 </div>