PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.3.4
Pods – Custom Content Types and Fields v3.3.4
trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / ui / admin / widgets / list.php
pods / ui / admin / widgets Last commit date
field.php 2 years ago form.php 2 years ago list.php 2 years ago single.php 2 years ago view.php 2 years ago
list.php
143 lines
1 <?php
2 // Don't load directly.
3 if ( ! defined( 'ABSPATH' ) ) {
4 die( '-1' );
5 }
6 ?>
7 <style type="text/css">
8 ol.pods_list_widget_form {
9 list-style: none;
10 padding-left: 0;
11 margin-left: 0;
12 }
13
14 ol.pods_list_widget_form label {
15 display: block;
16 }
17 </style>
18
19 <p><em><?php _e('You must specify a Pods Template or create a custom template, using <a href="https://docs.pods.io/displaying-pods/magic-tags/" title="Using Magic Tags" target="_blank" rel="noopener noreferrer">magic tags</a>.', 'pods'); ?></p></em>
20
21 <ol class="pods_list_widget_form">
22 <li>
23 <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"> <?php _e( 'Title', 'pods' ); ?></label>
24
25 <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $title ); ?>" />
26 </li>
27
28 <li>
29 <?php
30 $api = pods_api();
31 $all_pods = $api->load_pods( array( 'names' => true ) );
32 ?>
33 <label for="<?php echo esc_attr( $this->get_field_id( 'pod_type' ) ); ?>">
34 <?php _e( 'Pod', 'pods' ); ?>
35 </label>
36
37 <?php if ( 0 < count( $all_pods ) ): ?>
38 <select id="<?php echo esc_attr( $this->get_field_id( 'pod_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'pod_type' ) ); ?>">
39 <?php foreach ( $all_pods as $pod_name => $pod_label ): ?>
40 <option value="<?php echo esc_attr( $pod_name ); ?>"<?php selected( $pod_name, $pod_type ); ?>>
41 <?php echo esc_html( $pod_label . ' (' . $pod_name . ')' ); ?>
42 </option>
43 <?php endforeach; ?>
44 </select>
45 <?php else: ?>
46 <strong class="red"><?php _e( 'None Found', 'pods' ); ?></strong>
47 <?php endif; ?>
48 </li>
49
50 <?php
51 if ( class_exists( 'Pods_Templates' ) ) {
52 ?>
53 <li>
54 <?php
55 $all_templates = (array) $api->load_templates( array() );
56 ?>
57 <label for="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>"> <?php _e( 'Template', 'pods' ); ?> </label>
58
59 <select name="<?php echo esc_attr( $this->get_field_name( 'template' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>">
60 <option value="">- <?php _e( 'Custom Template', 'pods' ); ?> -</option>
61 <?php foreach ( $all_templates as $tpl ): ?>
62 <option value="<?php echo esc_attr( $tpl[ 'name' ] ); ?>"<?php echo selected( $tpl[ 'name' ], $template ); ?>>
63 <?php echo esc_html( $tpl[ 'name' ] ); ?>
64 </option>
65 <?php endforeach; ?>
66 </select>
67 </li>
68 <?php
69 }
70 else {
71 ?>
72 <li>
73 <label for="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>"> <?php _e( 'Template', 'pods' ); ?> </label>
74
75 <input class="widefat" type="text" id="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'template' ) ); ?>" value="<?php echo esc_attr( $template ); ?>" />
76 </li>
77 <?php
78 }
79 ?>
80
81 <li>
82 <label for="<?php echo esc_attr( $this->get_field_id( 'before_content' ) ); ?>"> <?php _e( 'Before Content', 'pods' ); ?></label>
83
84 <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'before_content' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'before_content' ) ); ?>" value="<?php echo esc_attr( $before_content ); ?>" />
85 </li>
86
87 <li>
88 <label for="<?php echo esc_attr( $this->get_field_id( 'template_custom' ) ); ?>"> <?php _e( 'Custom Template', 'pods' ); ?></label>
89
90 <textarea name="<?php echo esc_attr( $this->get_field_name( 'template_custom' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'template_custom' ) ); ?>" cols="10" rows="10" class="widefat"><?php echo esc_html( $template_custom ); ?></textarea>
91 </li>
92
93 <li>
94 <label for="<?php echo esc_attr( $this->get_field_id( 'after_content' ) ); ?>"> <?php _e( 'After Content', 'pods' ); ?></label>
95
96 <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'after_content' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'after_content' ) ); ?>" value="<?php echo esc_attr( $after_content ); ?>" />
97 </li>
98
99 <li>
100 <label for="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>"><?php _e( 'Limit', 'pods' ); ?></label>
101
102 <input class="widefat" type="text" id="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'limit' ) ); ?>" value="<?php echo esc_attr( $limit ); ?>" />
103 </li>
104
105 <li>
106 <label for="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>"><?php _e( 'Order By', 'pods' ); ?></label>
107
108 <input class="widefat" type="text" id="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'orderby' ) ); ?>" value="<?php echo esc_attr( $orderby ); ?>" />
109 </li>
110
111 <li>
112 <label for="<?php echo esc_attr( $this->get_field_id( 'where' ) ); ?>"><?php _e( 'Where', 'pods' ); ?></label>
113
114 <input class="widefat" type="text" id="<?php echo esc_attr( $this->get_field_id( 'where' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'where' ) ); ?>" value="<?php echo esc_attr( $where ); ?>" />
115 </li>
116
117 <li>
118 <label for="<?php echo esc_attr( $this->get_field_id( 'cache_mode' ) ); ?>"><?php _e( 'Cache Type', 'pods' ); ?></label>
119
120 <?php
121 $cache_modes = array(
122 'none' => __( 'Disable Caching', 'pods' ),
123 'cache' => __( 'Object Cache', 'pods' ),
124 'transient' => __( 'Transient', 'pods' ),
125 'site-transient' => __( 'Site Transient', 'pods' )
126 );
127 ?>
128 <select id="<?php echo esc_attr( $this->get_field_id( 'cache_mode' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'cache_mode' ) ); ?>">
129 <?php foreach ( $cache_modes as $cache_mode_option => $cache_mode_label ): ?>
130 <option value="<?php echo esc_attr( $cache_mode_option ); ?>"<?php selected( $cache_mode_option, $cache_mode ); ?>>
131 <?php echo esc_html( $cache_mode_label ); ?>
132 </option>
133 <?php endforeach; ?>
134 </select>
135 </li>
136
137 <li>
138 <label for="<?php echo esc_attr( $this->get_field_id( 'expires' ) ); ?>"><?php _e( 'Cache Expiration (in seconds)', 'pods' ); ?></label>
139
140 <input class="widefat" type="text" name="<?php echo esc_attr( $this->get_field_name( 'expires' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'expires' ) ); ?>" value="<?php echo esc_attr( $expires ); ?>" />
141 </li>
142 </ol>
143