auto-template
2 weeks ago
element-pod_reference-content.php
2 weeks ago
element-pod_reference.php
2 weeks ago
element-view_template.php
2 weeks ago
functions-pod_reference.php
2 weeks ago
functions-view_template.php
2 weeks ago
element-view_template.php
87 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Frontier Template code editor metabox |
| 4 | * |
| 5 | * @package Pods_templates |
| 6 | */ |
| 7 | |
| 8 | $has_php = false; |
| 9 | |
| 10 | $pods_output = ''; |
| 11 | |
| 12 | if ( isset( $content ) ) { |
| 13 | $has_php = false !== strpos( $content, '<?' ); |
| 14 | |
| 15 | // WordPress will already call esc_textarea() if richedit is off, don't escape twice (see #3462) |
| 16 | if ( ! user_can_richedit() ) { |
| 17 | // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped |
| 18 | $pods_output = $content; |
| 19 | } else { |
| 20 | $pods_output = esc_textarea( $content ); |
| 21 | } |
| 22 | } |
| 23 | ?> |
| 24 | <?php if ( $has_php ) : ?> |
| 25 | <?php |
| 26 | pods_deprecated( 'Pod Template PHP code has been deprecated, please use WP Templates instead of embedding PHP.', '2.3' ); |
| 27 | |
| 28 | printf( |
| 29 | ' |
| 30 | <div class="pods-ui-notice-admin pods-ui-notice-warning"> |
| 31 | <p>⚠️ %1$s</p> |
| 32 | <p><a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a> | <a href="%4$s" target="_blank" rel="noopener noreferrer">%5$s</a></p> |
| 33 | </div> |
| 34 | ', |
| 35 | esc_html__( 'PHP detected, this feature is deprecated', 'pods' ), |
| 36 | 'https://docs.pods.io/displaying-pods/pod-template-hierarchy-for-themes/', |
| 37 | esc_html__( 'Read more about file-based templates', 'pods' ), |
| 38 | admin_url( 'admin.php?page=pods-components' ), |
| 39 | esc_html__( 'Switch to file-based Pod Templates using our Migrate PHP into File-based templates component', 'pods' ) |
| 40 | ); |
| 41 | ?> |
| 42 | |
| 43 | <?php if ( PODS_DISABLE_EVAL ) : ?> |
| 44 | <?php |
| 45 | pods_message( |
| 46 | sprintf( |
| 47 | ' |
| 48 | <p><strong>%1$s:</strong> %2$s</p> |
| 49 | <p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a> | <a href="%5$s" target="_blank" rel="noopener noreferrer">%6$s</a></p> |
| 50 | ', |
| 51 | esc_html__( 'Pod Template Error', 'pods' ), |
| 52 | esc_html__( 'This template contains PHP code that will not run due to security restrictions in Pods. To enable PHP code, you must configure your website to allow PHP by setting the constant PODS_DISABLE_EVAL to false.', 'pods' ), |
| 53 | 'https://docs.pods.io/displaying-pods/pod-template-hierarchy-for-themes/', |
| 54 | esc_html__( 'Read more about file-based templates', 'pods' ), |
| 55 | admin_url( 'admin.php?page=pods-components' ), |
| 56 | esc_html__( 'Switch to file-based Pod Templates using our Migrate PHP into File-based templates component', 'pods' ) |
| 57 | ), |
| 58 | 'error', |
| 59 | false, |
| 60 | false |
| 61 | ); |
| 62 | ?> |
| 63 | <?php else : ?> |
| 64 | <?php |
| 65 | pods_message( |
| 66 | sprintf( |
| 67 | ' |
| 68 | <p><strong>%1$s:</strong> %2$s</p> |
| 69 | <p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a> | <a href="%5$s" target="_blank" rel="noopener noreferrer">%6$s</a></p> |
| 70 | ', |
| 71 | esc_html__( 'Pod Template Warning', 'pods' ), |
| 72 | esc_html__( 'This template contains PHP code that will no longer run in Pods 3.3+.', 'pods' ), |
| 73 | 'https://docs.pods.io/displaying-pods/pod-template-hierarchy-for-themes/', |
| 74 | esc_html__( 'Read more about file-based templates', 'pods' ), |
| 75 | admin_url( 'admin.php?page=pods-components' ), |
| 76 | esc_html__( 'Switch to file-based Pod Pages using our Migrate PHP into File-based templates component', 'pods' ) |
| 77 | ), |
| 78 | 'warning' |
| 79 | ); |
| 80 | ?> |
| 81 | <?php endif; ?> |
| 82 | <?php endif; ?> |
| 83 | |
| 84 | <div class="pods-compat-container"> |
| 85 | <textarea id="content" name="content"><?php echo $pods_output; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?></textarea> |
| 86 | </div> |
| 87 |