auto-template
4 months ago
element-pod_reference-content.php
4 months ago
element-pod_reference.php
4 months ago
element-view_template.php
4 months ago
functions-pod_reference.php
4 months ago
functions-view_template.php
4 months ago
element-pod_reference-content.php
45 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 | <?php if ( ! empty( $atts['pod'] ) ) : ?> |
| 11 | <p><?php esc_html_e( 'Magic tags can be used in your template code to reference field values from the pod.', 'pods' ); ?></p> |
| 12 | <p><strong><?php esc_html_e( 'Example', 'pods' ); ?>:</strong> <code>{@field_name}</code></p> |
| 13 | <p> |
| 14 | <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> |
| 15 | | <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> |
| 16 | </p> |
| 17 | <?php |
| 18 | $fields = pq_loadpod( $atts['pod'] ); |
| 19 | if ( ! empty( $fields ) ) : |
| 20 | ?> |
| 21 | <div id="pods-magic-tag-list" class="pods-magic-tag-list"> |
| 22 | <dl> |
| 23 | <dt><?php esc_html_e( 'Available magic tags', 'pods' ); ?></dt> |
| 24 | <dd><em><?php esc_html_e( 'You can click to copy any tag', 'pods' ); ?></em></dd> |
| 25 | <?php |
| 26 | foreach ( $fields as $field ) : |
| 27 | ?> |
| 28 | <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 ); ?>"> |
| 29 | <span><?php echo esc_html( $field ); ?></span> |
| 30 | </dd> |
| 31 | <?php |
| 32 | endforeach; |
| 33 | ?> |
| 34 | </dl> |
| 35 | </div> |
| 36 | <?php |
| 37 | endif; |
| 38 | ?> |
| 39 | <?php else : ?> |
| 40 | <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> |
| 41 | <p><strong><?php esc_html_e( 'Example', 'pods' ); ?>:</strong> <code>{@field_name}</code></p> |
| 42 | <p><?php esc_html_e( 'Save your Pod Template to have the reference update here.', 'pods' ); ?></p> |
| 43 | <?php |
| 44 | endif; |
| 45 |