| @@ -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 ) ) { |