| @@ -81,8 +81,13 @@ | ||
| 81 | 81 | /** |
| 82 | 82 | * @var WooInline|EDDInline |
| 83 | 83 | */ |
| 84 | 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 | + } | |
| 85 | 90 | $output = $extension->show_inline_notification( $atts, $settings); |
| 86 | 91 | if( !empty( $output ) ) { |
| 87 | 92 | $output = "<div id='notificationx-shortcode-inline-{$atts['id']}' class='notificationx-shortcode-inline-wrapper nx-shortcode-notice'>$output</div>"; |
| 88 | 93 | } |
| @@ -106,8 +111,13 @@ | ||
| 106 | 111 | array_multisort( $col, SORT_ASC, $entries ); |
| 107 | 112 | } |
| 108 | 113 | $entry = end( $entries ); |
| 109 | 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 | + } | |
| 110 | 120 | $_template = $template; |
| 111 | 121 | |
| 112 | 122 | foreach ( $entry as $key => $val ) { |
| 113 | 123 | if ( ! is_array( $val ) ) { |