PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / trunk
Pods – Custom Content Types and Fields vtrunk
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 / front / filters.php
pods / ui / front Last commit date
display 4 months ago pagination 4 months ago filters.php 4 months ago form.php 4 months ago view.php 4 months ago widgets.php 4 months ago
filters.php
42 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 /**
11 * @var Pods $pod
12 * @var array<string,\Pods\Whatsit\Field> $fields
13 * @var string $action
14 * @var string $search
15 * @var string $label
16 */
17 ?>
18 <form method="get" class="pods-form-filters pods-form-filters-<?php echo esc_attr( $pod->pod ); ?>" action="<?php echo esc_attr( $action ); ?>">
19 <?php
20 foreach ( $fields as $name => $field ) {
21 if ( in_array( $field['type'], array( 'pick', 'taxonomy' ), true ) && 'pick-custom' !== $field['pick_object'] && ! empty( $field['pick_object'] ) ) {
22 $field['pick_format_type'] = 'single';
23 $field['pick_format_single'] = 'dropdown';
24 $field['pick_select_text'] = '-- ' . $field['label'] . ' --';
25 $field['pick_show_select_text'] = 1;
26 $field['pick_select_text_always_show'] = 1;
27
28 $filter = sanitize_text_field( pods_v( $pod->filter_var . '_' . $name, 'get', '' ) );
29
30 // @todo Support other field types.
31 $field['type'] = 'pick';
32
33 PodsForm::output_field( $pod->filter_var . '_' . $name, $filter, $field['type'], $field, $pod->pod, $pod->id() );
34 }
35 }
36 ?>
37
38 <input type="text" class="pods-form-filters-search" name="<?php echo esc_attr( $pod->search_var ); ?>" value="<?php echo esc_attr( $search ); ?>" />
39
40 <input type="submit" class="pods-form-filters-submit" value="<?php echo esc_attr( $label ); ?>" />
41 </form>
42