PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.3.3
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.3.3
3.3.3 3.3.2 3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 All 158 releases
← All changes | includes/Extensions/LearnPress/LearnPressInline.php +12 -11 3.2.14 → 3.3.3 View file →
@@ -84,22 +84,23 @@
84 84 ];
85 85 }
86 86
87 87 /**
88 - * @todo Something
88 + * Keep this source's notifications out of the popup loop in
89 + * FrontEnd::get_notifications_ids(). They render inline at the hooks
90 + * chosen in `inline_location`, never as a floating popup.
89 91 *
90 - * @param [type] $exclude
91 - * @param [type] $settings
92 - * @return void
92 + * `inline_location` is not read here on purpose: it can be saved as ''
93 + * (MCP or Quick Builder create without the field), and passing that to
94 + * array_diff() is a TypeError on PHP 8 that white-screens every page.
95 + *
96 + * @param bool $exclude Whether an earlier callback already excluded it.
97 + * @param array $settings Notification settings.
98 + * @return bool
93 99 */
94 100 public function show_on_exclude( $exclude, $settings ) {
95 - if ( 'inline' === $settings['type'] && $settings['source'] === $this->id ) {
96 - $edd_location = $settings['inline_location'];
97 - $hooks = [ 'learn-press/list-courses/layout/item/section/bottom', 'learn-press/after-course-buttons' ];
98 - $diff = array_diff( $hooks, $edd_location );
99 - if ( count( $diff ) <= count( $hooks ) ) {
100 - return true;
101 - }
101 + if ( isset( $settings['type'], $settings['source'] ) && 'inline' === $settings['type'] && $this->id === $settings['source'] ) {
102 + return true;
102 103 }
103 104 return $exclude;
104 105 }
105 106