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 / field.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
field.php
73 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_field_widget_form {
12 list-style: none;
13 padding-left: 0;
14 margin-left: 0;
15 }
16
17 ol.pods_field_widget_form label {
18 display: block;
19 }
20 </style>
21
22 <ol class="pods_field_widget_form">
23 <li>
24 <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'pods' ); ?></label>
25
26 <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 ); ?>" />
27 </li>
28
29 <li>
30 <?php
31 $api = pods_api();
32 $all_pods = $api->load_pods( array( 'names' => true ) );
33 ?>
34 <label for="<?php echo esc_attr( $this->get_field_id( 'pod_type' ) ); ?>">
35 <?php esc_html_e( 'Pod', 'pods' ); ?>
36 </label>
37
38 <?php if ( 0 < count( $all_pods ) ) : ?>
39 <select id="<?php echo esc_attr( $this->get_field_id( 'pod_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'pod_type' ) ); ?>">
40 <?php foreach ( $all_pods as $pod_name => $pod_label ) : ?>
41 <option value="<?php echo esc_attr( $pod_name ); ?>" <?php selected( $pod_name, $pod_type ); ?>>
42 <?php echo esc_html( $pod_label . ' (' . $pod_name . ')' ); ?>
43 </option>
44 <?php endforeach; ?>
45 </select>
46 <?php else : ?>
47 <strong class="red"><?php esc_html_e( 'None Found', 'pods' ); ?></strong>
48 <?php endif; ?>
49 </li>
50
51 <li>
52 <label for="<?php echo esc_attr( $this->get_field_id( 'slug' ) ); ?>">
53 <?php esc_html_e( 'Slug or ID', 'pods' ); ?>
54 </label>
55
56 <input class="widefat" type="text" id="<?php echo esc_attr( $this->get_field_id( 'slug' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'slug' ) ); ?>" value="<?php echo esc_attr( $slug ); ?>" />
57 </li>
58
59 <li>
60 <label for="<?php echo esc_attr( $this->get_field_id( 'use_current' ) ); ?>">
61 <?php esc_html_e( 'Use current post (singular) or term (term archive)', 'pods' ); ?>
62 </label>
63
64 <input type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'use_current' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'use_current' ) ); ?>" value="1"<?php checked( $use_current, '1' ); ?> />
65 </li>
66
67 <li>
68 <label for="<?php echo esc_attr( $this->get_field_id( 'field' ) ); ?>"><?php esc_html_e( 'Field', 'pods' ); ?></label>
69
70 <input class="widefat" type="text" name="<?php echo esc_attr( $this->get_field_name( 'field' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'field' ) ); ?>" value="<?php echo esc_attr( $field ); ?>" />
71 </li>
72 </ol>
73