PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.2.2
Pods – Custom Content Types and Fields v3.2.2
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 / form.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
form.php
72 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_form_widget_form {
9 list-style: none;
10 padding-left: 0;
11 margin-left: 0;
12 }
13
14 ol.pods_form_widget_form label {
15 display: block;
16 }
17 </style>
18
19 <ol class="pods_form_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 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' ) ); ?>"><?php _e( 'ID or Slug', 'pods' ); ?></label>
50
51 <input class="widefat" type="text" name="<?php echo $this->get_field_name( 'slug' ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'slug' ) ); ?>" value="<?php echo esc_attr( $slug ); ?>" />
52 </li>
53
54 <li>
55 <label for="<?php echo esc_attr( $this->get_field_id( 'fields' ) ); ?>"><?php _e( 'Fields (comma-separated)', 'pods' ); ?></label>
56
57 <input class="widefat" type="text" name="<?php echo esc_attr( $this->get_field_name( 'fields' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'fields' ) ); ?>" value="<?php echo esc_attr( $fields ); ?>" />
58 </li>
59
60 <li>
61 <label for="<?php echo esc_attr( $this->get_field_id( 'label' ) ); ?>"><?php _e( 'Submit Label', 'pods' ); ?></label>
62
63 <input class="widefat" type="text" name="<?php echo esc_attr( $this->get_field_name( 'label' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'label' ) ); ?>" value="<?php echo esc_attr( $label ); ?>" />
64 </li>
65
66 <li>
67 <label for="<?php echo esc_attr( $this->get_field_id( 'thank_you' ) ); ?>"><?php _e( 'Thank You URL upon submission', 'pods' ); ?></label>
68
69 <input class="widefat" type="text" name="<?php echo esc_attr( $this->get_field_name( 'thank_you' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'thank_you' ) ); ?>" value="<?php echo esc_attr( $thank_you ); ?>" />
70 </li>
71 </ol>
72