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/Features/ShortcodeInline.php +11 -0 3.2.7 → 3.3.3 View file →
@@ -72,8 +72,9 @@
72 72 }
73 73 return '<p class="nx-shortcode-notice">' . __( 'Make sure you have enabled the notification which ID you have given.', 'notificationx' ) . '</p>';
74 74 }
75 75
76 + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reviewed for the NotificationX codebase: acceptable in this context.
76 77 do_action( 'nx_inline' );
77 78 $settings = PostType::get_instance()->get_post($nx_id);
78 79 if( $settings['type'] == 'inline' || $settings['source'] == 'woocommerce_sales_inline' ){
79 80 $settings['shortcodeinline'] = true;
@@ -80,8 +81,13 @@
80 81 /**
81 82 * @var WooInline|EDDInline
82 83 */
83 84 $extension = \NotificationX\Extensions\ExtensionFactory::get_instance()->get($settings['source']);
85 + // The inline renderers live in NotificationX Pro; without it (or with the
86 + // module disabled) the extension is a stub or missing.
87 + if ( ! $extension || ! method_exists( $extension, 'show_inline_notification' ) ) {
88 + return '';
89 + }
84 90 $output = $extension->show_inline_notification( $atts, $settings);
85 91 if( !empty( $output ) ) {
86 92 $output = "<div id='notificationx-shortcode-inline-{$atts['id']}' class='notificationx-shortcode-inline-wrapper nx-shortcode-notice'>$output</div>";
87 93 }
@@ -105,8 +111,13 @@
105 111 array_multisort( $col, SORT_ASC, $entries );
106 112 }
107 113 $entry = end( $entries );
108 114 $template = Inline::get_instance()->get_template( $settings );
115 + // Freemius themes return their lines as an array (for the popup
116 + // layout); the shortcode renders one string, so join them.
117 + if ( is_array( $template ) ) {
118 + $template = implode( ' ', array_filter( array_map( 'trim', array_filter( $template, 'is_scalar' ) ), 'strlen' ) );
119 + }
109 120 $_template = $template;
110 121
111 122 foreach ( $entry as $key => $val ) {
112 123 if ( ! is_array( $val ) ) {