PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.3.8
Pods – Custom Content Types and Fields v3.3.8
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 4 months ago form.php 4 months ago list.php 4 months ago single.php 4 months ago view.php 4 months ago
list.php
146 lines
1 <?php
2
3 // Don't load directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 die( '-1' );
6 }
7
8 // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
9 ?>
10 <style type="text/css">
11 ol.pods_list_widget_form {
12 list-style: none;
13 padding-left: 0;
14 margin-left: 0;
15 }
16
17 ol.pods_list_widget_form label {
18 display: block;
19 }
20 </style>
21
22 <p><em><?php esc_html_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>
23
24 <ol class="pods_list_widget_form">
25 <li>
26 <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'pods' ); ?></label>
27
28 <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 ); ?>" />
29 </li>
30
31 <li>
32 <?php
33 $api = pods_api();
34 $all_pods = $api->load_pods( array( 'names' => true ) );
35 ?>
36 <label for="<?php echo esc_attr( $this->get_field_id( 'pod_type' ) ); ?>">
37 <?php esc_html_e( 'Pod', 'pods' ); ?>
38 </label>
39
40 <?php if ( 0 < count( $all_pods ) ): ?>
41 <select id="<?php echo esc_attr( $this->get_field_id( 'pod_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'pod_type' ) ); ?>">
42 <?php foreach ( $all_pods as $pod_name => $pod_label ): ?>
43 <option value="<?php echo esc_attr( $pod_name ); ?>"<?php selected( $pod_name, $pod_type ); ?>>
44 <?php echo esc_html( $pod_label . ' (' . $pod_name . ')' ); ?>
45 </option>
46 <?php endforeach; ?>
47 </select>
48 <?php else: ?>
49 <strong class="red"><?php esc_html_e( 'None Found', 'pods' ); ?></strong>
50 <?php endif; ?>
51 </li>
52
53 <?php
54 if ( class_exists( 'Pods_Templates' ) ) {
55 ?>
56 <li>
57 <?php
58 $all_templates = (array) $api->load_templates( array() );
59 ?>
60 <label for="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>"><?php esc_html_e( 'Template', 'pods' ); ?> </label>
61
62 <select name="<?php echo esc_attr( $this->get_field_name( 'template' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>">
63 <option value="">- <?php esc_html_e( 'Custom Template', 'pods' ); ?> -</option>
64 <?php foreach ( $all_templates as $tpl ): ?>
65 <option value="<?php echo esc_attr( $tpl[ 'name' ] ); ?>"<?php selected( $tpl[ 'name' ], $template ); ?>>
66 <?php echo esc_html( $tpl[ 'name' ] ); ?>
67 </option>
68 <?php endforeach; ?>
69 </select>
70 </li>
71 <?php
72 }
73 else {
74 ?>
75 <li>
76 <label for="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>"><?php esc_html_e( 'Template', 'pods' ); ?> </label>
77
78 <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 ); ?>" />
79 </li>
80 <?php
81 }
82 ?>
83
84 <li>
85 <label for="<?php echo esc_attr( $this->get_field_id( 'before_content' ) ); ?>"><?php esc_html_e( 'Before Content', 'pods' ); ?></label>
86
87 <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 ); ?>" />
88 </li>
89
90 <li>
91 <label for="<?php echo esc_attr( $this->get_field_id( 'template_custom' ) ); ?>"><?php esc_html_e( 'Custom Template', 'pods' ); ?></label>
92
93 <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>
94 </li>
95
96 <li>
97 <label for="<?php echo esc_attr( $this->get_field_id( 'after_content' ) ); ?>"><?php esc_html_e( 'After Content', 'pods' ); ?></label>
98
99 <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 ); ?>" />
100 </li>
101
102 <li>
103 <label for="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'pods' ); ?></label>
104
105 <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 ); ?>" />
106 </li>
107
108 <li>
109 <label for="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>"><?php esc_html_e( 'Order By', 'pods' ); ?></label>
110
111 <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 ); ?>" />
112 </li>
113
114 <li>
115 <label for="<?php echo esc_attr( $this->get_field_id( 'where' ) ); ?>"><?php esc_html_e( 'Where', 'pods' ); ?></label>
116
117 <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 ); ?>" />
118 </li>
119
120 <li>
121 <label for="<?php echo esc_attr( $this->get_field_id( 'cache_mode' ) ); ?>"><?php esc_html_e( 'Cache Type', 'pods' ); ?></label>
122
123 <?php
124 $cache_modes = array(
125 'none' => __( 'Disable Caching', 'pods' ),
126 'cache' => __( 'Object Cache', 'pods' ),
127 'transient' => __( 'Transient', 'pods' ),
128 'site-transient' => __( 'Site Transient', 'pods' )
129 );
130 ?>
131 <select id="<?php echo esc_attr( $this->get_field_id( 'cache_mode' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'cache_mode' ) ); ?>">
132 <?php foreach ( $cache_modes as $cache_mode_option => $cache_mode_label ): ?>
133 <option value="<?php echo esc_attr( $cache_mode_option ); ?>"<?php selected( $cache_mode_option, $cache_mode ); ?>>
134 <?php echo esc_html( $cache_mode_label ); ?>
135 </option>
136 <?php endforeach; ?>
137 </select>
138 </li>
139
140 <li>
141 <label for="<?php echo esc_attr( $this->get_field_id( 'expires' ) ); ?>"><?php esc_html_e( 'Cache Expiration (in seconds)', 'pods' ); ?></label>
142
143 <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 ); ?>" />
144 </li>
145 </ol>
146