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