auto-template
2 years ago
element-pod_reference-content.php
2 years ago
element-pod_reference.php
2 years ago
element-view_template.php
7 years ago
functions-pod_reference.php
2 years ago
functions-view_template.php
2 years ago
element-pod_reference-content.php
35 lines
| 1 | <?php if ( ! empty( $atts['pod'] ) ) : ?> |
| 2 | <p><?php esc_html_e( 'Magic tags can be used in your template code to reference field values from the pod.', 'pods' ); ?></p> |
| 3 | <p><strong><?php esc_html_e( 'Example', 'pods' ); ?>:</strong> <code>{@field_name}</code></p> |
| 4 | <p> |
| 5 | <a href="https://docs.pods.io/displaying-pods/magic-tags/" target="_blank" rel="noreferrer noopener"><?php esc_html_e( 'Read more about magic tags', 'pods' ); ?></a> |
| 6 | | <a href="https://docs.pods.io/displaying-pods/template-tags/" target="_blank" rel="noreferrer noopener"><?php esc_html_e( 'Read more about template tags like [if], [else], [each], and more', 'pods' ); ?></a> |
| 7 | </p> |
| 8 | <?php |
| 9 | $fields = pq_loadpod( $atts['pod'] ); |
| 10 | if ( ! empty( $fields ) ) : |
| 11 | ?> |
| 12 | <div id="pods-magic-tag-list" class="pods-magic-tag-list"> |
| 13 | <dl> |
| 14 | <dt><?php esc_html_e( 'Available magic tags', 'pods' ); ?></dt> |
| 15 | <dd><em><?php esc_html_e( 'You can click to copy any tag', 'pods' ); ?></em></dd> |
| 16 | <?php |
| 17 | foreach ( $fields as $field ) : |
| 18 | ?> |
| 19 | <dd class="pods-magic-tag-option" data-tag="<?php echo esc_attr( $field ); ?>" title="<?php esc_attr_e( 'Field', 'pods' ); ?>: <?php echo esc_attr( $field ); ?>"> |
| 20 | <span><?php echo esc_html( $field ); ?></span> |
| 21 | </dd> |
| 22 | <?php |
| 23 | endforeach; |
| 24 | ?> |
| 25 | </dl> |
| 26 | </div> |
| 27 | <?php |
| 28 | endif; |
| 29 | ?> |
| 30 | <?php else : ?> |
| 31 | <p><?php esc_html_e( 'Selecting a Pod will allow you to see the list of available magic tags that can be used in your template code.', 'pods' ); ?></p> |
| 32 | <p><strong><?php esc_html_e( 'Example', 'pods' ); ?>: <code>{@field_name}</code></p> |
| 33 | <?php |
| 34 | endif; |
| 35 |