Helpers
11 months ago
Integrations
1 week ago
RestApi
2 weeks ago
abilities
2 weeks ago
abstracts
2 weeks ago
admin
2 weeks ago
blocks
1 year ago
elementor
2 years ago
export
2 months ago
fields
2 weeks ago
interfaces
8 years ago
libraries
2 years ago
log-handlers
1 year ago
shortcodes
2 weeks ago
stats
5 months ago
templates
3 months ago
traits
2 weeks ago
class-everest-forms.php
1 week ago
class-evf-addon-upsell.php
2 weeks ago
class-evf-ajax.php
2 weeks ago
class-evf-autoloader.php
7 years ago
class-evf-background-process-import-entries.php
1 year ago
class-evf-background-updater.php
7 years ago
class-evf-cache-helper.php
2 months ago
class-evf-cron.php
2 years ago
class-evf-deprecated-action-hooks.php
6 years ago
class-evf-deprecated-filter-hooks.php
5 years ago
class-evf-email-entries-report.php
3 months ago
class-evf-emails.php
2 weeks ago
class-evf-fields.php
2 weeks ago
class-evf-form-handler.php
2 weeks ago
class-evf-form-task.php
2 weeks ago
class-evf-forms-features.php
2 weeks ago
class-evf-frontend-scripts.php
2 weeks ago
class-evf-install.php
2 months ago
class-evf-integrations.php
3 months ago
class-evf-log-levels.php
8 years ago
class-evf-logger.php
5 years ago
class-evf-post-types.php
1 year ago
class-evf-privacy.php
6 years ago
class-evf-report-cron.php
2 months ago
class-evf-reporting.php
2 months ago
class-evf-session-handler.php
7 years ago
class-evf-shortcodes.php
1 year ago
class-evf-smart-tags.php
9 months ago
class-evf-template-loader.php
1 year ago
class-evf-validation.php
6 years ago
evf-conditional-functions.php
6 years ago
evf-core-functions.php
2 weeks ago
evf-deprecated-functions.php
6 years ago
evf-entry-functions.php
4 months ago
evf-formatting-functions.php
4 years ago
evf-notice-functions.php
4 years ago
evf-template-functions.php
4 years ago
evf-template-hooks.php
7 years ago
evf-update-functions.php
5 years ago
evf-template-functions.php
67 lines
| 1 | <?php |
| 2 | /** |
| 3 | * EverestForms Template |
| 4 | * |
| 5 | * Functions for the templating system. |
| 6 | * |
| 7 | * @package EverestForms/Functions |
| 8 | * @version 1.0.0 |
| 9 | */ |
| 10 | |
| 11 | defined( 'ABSPATH' ) || exit; |
| 12 | |
| 13 | /** |
| 14 | * Add body classes for EVF pages. |
| 15 | * |
| 16 | * @param array $classes Body Classes. |
| 17 | * @return array |
| 18 | */ |
| 19 | function evf_body_class( $classes ) { |
| 20 | $classes = (array) $classes; |
| 21 | |
| 22 | $classes[] = 'everest-forms-no-js'; |
| 23 | |
| 24 | add_action( 'wp_footer', 'evf_no_js' ); |
| 25 | |
| 26 | return array_unique( $classes ); |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * NO JS handling. |
| 31 | * |
| 32 | * @since 1.2.0 |
| 33 | */ |
| 34 | function evf_no_js() { |
| 35 | if ( evf_is_amp() ) { |
| 36 | return; |
| 37 | } |
| 38 | ?> |
| 39 | <script type="text/javascript"> |
| 40 | var c = document.body.className; |
| 41 | c = c.replace( /everest-forms-no-js/, 'everest-forms-js' ); |
| 42 | document.body.className = c; |
| 43 | </script> |
| 44 | <?php |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Output generator tag to aid debugging. |
| 49 | * |
| 50 | * @param string $gen Generator. |
| 51 | * @param string $type Type. |
| 52 | * |
| 53 | * @return string |
| 54 | */ |
| 55 | function evf_generator_tag( $gen, $type ) { |
| 56 | switch ( $type ) { |
| 57 | case 'html': |
| 58 | $gen .= "\n" . '<meta name="generator" content="Everest Forms ' . esc_attr( EVF_VERSION ) . '">'; |
| 59 | break; |
| 60 | case 'xhtml': |
| 61 | $gen .= "\n" . '<meta name="generator" content="Everest Forms ' . esc_attr( EVF_VERSION ) . '" />'; |
| 62 | break; |
| 63 | } |
| 64 | |
| 65 | return $gen; |
| 66 | } |
| 67 |