← All changes
|
includes/admin/settings/integration/facebook-integration.php
+4
-2
1.5.8
→
2.7.0
View file →
| @@ -83,9 +83,9 @@ | ||
| 83 | 83 | // phpcs:enable |
| 84 | 84 | |
| 85 | 85 | $facebook_script .= $this->facebook_pixel_events( self::$post, $fb_tracking_id ); |
| 86 | 86 | |
| 87 | - echo $facebook_script; | |
| 87 | + echo $facebook_script; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Inline pixel script; tracking IDs escaped with esc_js. | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * Facebook pixel events scripts. |
| @@ -100,9 +100,11 @@ | ||
| 100 | 100 | if ( empty( $fb_pixel_events ) ) { |
| 101 | 101 | return; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $sellkit_page_meta = $post_meta[0]['type']['key']; | |
| 104 | + $first_index = array_key_first( $post_meta ); | |
| 105 | + | |
| 106 | + $sellkit_page_meta = $post_meta[ $first_index ]['type']['key']; | |
| 105 | 107 | $fb_events_script = ''; |
| 106 | 108 | |
| 107 | 109 | foreach ( $fb_pixel_events as $event ) { |
| 108 | 110 | $function_name = "fb_pixel_{$event}"; |