PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.11.10
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.11.10
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | vendor/codeinwp/themeisle-sdk/src/Modules/Notification.php +24 -1 3.10.03.11.10 View file →
@@ -255,8 +255,9 @@
255 255 public static function get_notification_html( $notification_details ) {
256 256 $default = [
257 257 'id' => '',
258 258 'heading' => '',
259 + 'img_src' => '',
259 260 'message' => '',
260 261 'ctas' => [
261 262 'confirm' => [
262 263 'link' => '#',
@@ -266,19 +267,28 @@
266 267 'link' => '#',
267 268 'text' => '',
268 269 ],
269 270 ],
271 + 'type' => 'success',
270 272 ];
271 273 $notification_details = wp_parse_args( $notification_details, $default );
272 274 global $pagenow;
275 + $type = in_array( $notification_details['type'], [ 'success', 'info', 'warning', 'error' ], true ) ? $notification_details['type'] : 'success';
273 276 $notification_details['ctas']['cancel']['link'] = wp_nonce_url( add_query_arg( [ 'nid' => $notification_details['id'] ], admin_url( $pagenow ) ), $notification_details['id'], 'tsdk_dismiss_nonce' );
274 - $notification_html = '<div class="notice notice-success is-dismissible themeisle-sdk-notice" data-notification-id="' . esc_attr( $notification_details['id'] ) . '" id="' . esc_attr( $notification_details['id'] ) . '-notification"> <div class="themeisle-sdk-notification-box">';
277 + $notification_html = '<div class="notice notice-' . $type . ' is-dismissible themeisle-sdk-notice" data-notification-id="' . esc_attr( $notification_details['id'] ) . '" id="' . esc_attr( $notification_details['id'] ) . '-notification"> <div class="themeisle-sdk-notification-box">';
275 278
276 279 if ( ! empty( $notification_details['heading'] ) ) {
277 280 $notification_html .= sprintf( '<h4>%s</h4>', wp_kses_post( $notification_details['heading'] ) );
278 281 }
282 + if ( ! empty( $notification_details['img_src'] ) ) {
283 + $notification_html .= '<div class="wrap-flex">';
284 + $notification_html .= sprintf( '<img src="%s" alt="%s" />', esc_attr( $notification_details['img_src'] ), esc_attr( $notification_details['heading'] ) );
285 + }
279 286 if ( ! empty( $notification_details['message'] ) ) {
280 287 $notification_html .= wp_kses_post( $notification_details['message'] );
288 + if ( ! empty( $notification_details['img_src'] ) ) {
289 + $notification_html .= '</div>';
290 + }
281 291 }
282 292 $notification_html .= '<div class="actions">';
283 293
284 294 if ( ! empty( $notification_details['ctas']['confirm']['text'] ) ) {
@@ -316,8 +326,20 @@
316 326 .themeisle-sdk-notification-box {
317 327 padding: 3px;
318 328 }
319 329
330 + .themeisle-sdk-notification-box .wrap-flex {
331 + display: flex;
332 + align-items: center;
333 + justify-content: start;
334 + gap: 12px;
335 + }
336 +
337 + .themeisle-sdk-notification-box .wrap-flex img {
338 + width: 42px;
339 + object-fit: cover;
340 + }
341 +
320 342 .themeisle-sdk-notification-box .actions {
321 343 margin-top: 6px;
322 344 margin-bottom: 4px;
323 345 }
@@ -376,8 +398,9 @@
376 398
377 399 if ( empty( $id ) ) {
378 400 wp_send_json( [] );
379 401 }
402 + self::setup_notifications();
380 403 $ids = wp_list_pluck( self::$notifications, 'id' );
381 404 if ( ! in_array( $id, $ids, true ) ) {
382 405 wp_send_json( [] );
383 406 }