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
view.php
51 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 | pods_form_enqueue_style( 'pods-form' ); |
| 11 | |
| 12 | /** |
| 13 | * @var array $fields |
| 14 | * @var Pods $pod |
| 15 | */ |
| 16 | ?> |
| 17 | <div class="pods-submittable-fields"> |
| 18 | <ul class="pods-form-fields"> |
| 19 | <?php |
| 20 | foreach ( $fields as $field ) { |
| 21 | if ( isset( $field['custom_display'] ) && is_callable( $field['custom_display'] ) ) { |
| 22 | $value = call_user_func_array( |
| 23 | $field['custom_display'], array( |
| 24 | $pod->row(), |
| 25 | $pod, |
| 26 | $pod->field( $field['name'] ), |
| 27 | $field['name'], |
| 28 | $field, |
| 29 | ) |
| 30 | ); |
| 31 | } else { |
| 32 | $value = $pod->display( $field['name'] ); |
| 33 | } |
| 34 | $default_class = ' pods-form-ui-row-type-' . $field['type'] . ' pods-form-ui-row-name-' . PodsForm::clean( $field[ 'name' ] ); |
| 35 | $html_class = apply_filters( 'pods-field-html-class', $field ) . $default_class; |
| 36 | ?> |
| 37 | <li class="pods-field__container pods-field <?php echo esc_attr( $html_class, true ); ?>"> |
| 38 | <div class="pods-field-label"> |
| 39 | <strong><?php echo esc_html($field['label'] ); ?></strong> |
| 40 | </div> |
| 41 | |
| 42 | <div class="pods-field-input"> |
| 43 | <?php echo wp_kses_post( $value ); ?> |
| 44 | </div> |
| 45 | </li> |
| 46 | <?php |
| 47 | }//end foreach |
| 48 | ?> |
| 49 | </ul> |
| 50 | </div> |
| 51 |