← All changes
|
includes/admin/settings/integration/google-integration.php
+4
-2
1.5.8
→
2.7.0
View file →
| @@ -72,9 +72,9 @@ | ||
| 72 | 72 | // phpcs:enable |
| 73 | 73 | |
| 74 | 74 | $google_script .= $this->google_analytics_events( self::$post, $google_tracking_id ); |
| 75 | 75 | |
| 76 | - echo $google_script; | |
| 76 | + echo $google_script; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Inline analytics script; tracking IDs escaped with esc_js. | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | 80 | * Get google analyticts events scripts. |
| @@ -89,9 +89,11 @@ | ||
| 89 | 89 | if ( empty( $google_events ) ) { |
| 90 | 90 | return; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $sellkit_page_meta = $post_meta[0]['type']['key']; | |
| 93 | + $first_index = array_key_first( $post_meta ); | |
| 94 | + | |
| 95 | + $sellkit_page_meta = $post_meta[ $first_index ]['type']['key']; | |
| 94 | 96 | $google_events_script = ''; |
| 95 | 97 | |
| 96 | 98 | foreach ( $google_events as $event ) { |
| 97 | 99 | $function_name = "google_analytics_{$event}"; |