|
1 | 1 | <?php |
2 | 2 | /** |
3 | | - * Template Name: Map app |
| 3 | + * Template Name: fw-child/apps/app-map.php |
4 | 4 | * |
5 | | - * To ensure the map React app loads correctly without any JavaScript or CSS conflicts |
| 5 | + * To ensure the app loads correctly without any JavaScript or CSS conflicts |
6 | 6 | * with the theme's assets, a custom WP page template was created instead of using |
7 | 7 | * a builder template. |
8 | 8 | * |
|
13 | 13 | $assets = cdc_app_asset_load( 'map' ); |
14 | 14 |
|
15 | 15 | if ( ! is_array( $assets ) || empty( $assets ) ) { |
16 | | - wp_die( 'Error: could not load the map app!' ); |
| 16 | + wp_die( 'Error: could not load the app!' ); |
17 | 17 | } |
18 | 18 |
|
19 | 19 | // Initialize current language. |
|
44 | 44 | ]; |
45 | 45 |
|
46 | 46 | $locale_data = cdc_extract_locale_data( 'react-apps', get_locale() ); |
47 | | -?> |
48 | 47 |
|
| 48 | +?> |
49 | 49 | <!DOCTYPE html> |
50 | 50 | <html lang="<?php echo esc_attr( $current_lang ); ?>"> |
51 | 51 | <head> |
|
58 | 58 | // Add favicon. |
59 | 59 | add_favicon(); |
60 | 60 |
|
61 | | - // Load the translation data for the map app |
| 61 | + // Load the translation data for the app |
62 | 62 | if ( count( $locale_data ) ) { |
63 | 63 | ?> |
64 | 64 | <script src="<?php echo esc_url( get_site_url() . '/wp-includes/js/dist/hooks.min.js' ); ?>"></script> |
|
74 | 74 | ?> |
75 | 75 |
|
76 | 76 | <script> |
77 | | - // URL encoder salt for the map app |
| 77 | + // URL encoder salt for the app |
78 | 78 | window.URL_ENCODER_SALT = '<?php echo isset( $GLOBALS['vars']['url_encoder_salt'] ) ? htmlspecialchars( $GLOBALS['vars']['url_encoder_salt'], ENT_QUOTES, 'UTF-8' ) : ''; ?>'; |
79 | 79 |
|
80 | | - // DATA URL for the map app |
| 80 | + // DATA URL for the app |
81 | 81 | window.DATA_URL = '<?php echo isset( $GLOBALS['vars']['data_url'] ) ? htmlspecialchars( $GLOBALS['vars']['data_url'], ENT_QUOTES, 'UTF-8' ) : ''; ?>'; |
82 | 82 |
|
83 | 83 | // Disable Leaflet's 3D features |
84 | 84 | L_DISABLE_3D = true; |
85 | 85 |
|
86 | | - // WP AJAX URL for the map app |
| 86 | + // WP AJAX URL for the app |
87 | 87 | window.wpAjaxUrl = '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>'; |
88 | 88 | </script> |
89 | 89 |
|
|
0 commit comments