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/LearnDash/LearnDashInline.php +12 -11 3.2.12 → 3.3.3 View file →
@@ -71,22 +71,23 @@
71 71 ];
72 72 }
73 73
74 74 /**
75 - * @todo Something
75 + * Keep this source's notifications out of the popup loop in
76 + * FrontEnd::get_notifications_ids(). They render inline at the hooks
77 + * chosen in `inline_location`, never as a floating popup.
76 78 *
77 - * @param [type] $exclude
78 - * @param [type] $settings
79 - * @return void
79 + * `inline_location` is not read here on purpose: it can be saved as ''
80 + * (MCP or Quick Builder create without the field), and passing that to
81 + * array_diff() is a TypeError on PHP 8 that white-screens every page.
82 + *
83 + * @param bool $exclude Whether an earlier callback already excluded it.
84 + * @param array $settings Notification settings.
85 + * @return bool
80 86 */
81 87 public function show_on_exclude( $exclude, $settings ) {
82 - if ( 'inline' === $settings['type'] && $settings['source'] === $this->id ) {
83 - $edd_location = $settings['inline_location'];
84 - $hooks = [ 'tutor_course/loop/after_title' ];
85 - $diff = array_diff( $hooks, $edd_location );
86 - if ( count( $diff ) <= count( $hooks ) ) {
87 - return true;
88 - }
88 + if ( isset( $settings['type'], $settings['source'] ) && 'inline' === $settings['type'] && $this->id === $settings['source'] ) {
89 + return true;
89 90 }
90 91 return $exclude;
91 92 }
92 93