← All changes
|
includes/Extensions/ExitIntent/ExitIntentNotification.php
+37
-3
3.2.9
→
trunk
View file →
| @@ -74,9 +74,9 @@ | ||
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | echo "<style id='nx-exit-intent-section-constraint'>\n"; |
| 77 | 77 | if ( '' !== $vars ) { |
| 78 | - echo "body.single-nx_exit_intent{" . $vars . "}\n"; | |
| 78 | + echo "body.single-nx_exit_intent{" . esc_html( $vars ) . "}\n"; | |
| 79 | 79 | } |
| 80 | 80 | echo ".nx-exit-intent-section{width:100%!important;max-width:var(--nx-exit-width,540px)!important;margin-left:auto!important;margin-right:auto!important;}\n"; |
| 81 | 81 | if ( is_singular( 'nx_exit_intent' ) ) { |
| 82 | 82 | echo "body.single-nx_exit_intent .elementor-section,body.single-nx_exit_intent .e-con{width:100%!important;max-width:var(--nx-exit-width,540px)!important;margin-left:auto!important;margin-right:auto!important;}\n"; |
| @@ -104,8 +104,9 @@ | ||
| 104 | 104 | $settings['mode'] = 'built_in'; |
| 105 | 105 | return $settings; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reviewed for the NotificationX codebase: acceptable in this context. | |
| 108 | 109 | $resolved_id = apply_filters( 'wpml_object_id', $elementor_id, 'nx_exit_intent', true ); |
| 109 | 110 | $html = \Elementor\Plugin::$instance->frontend->get_builder_content_for_display( $resolved_id, false ); |
| 110 | 111 | |
| 111 | 112 | // Surface the Layout-panel settings (registered in register_popup_layout_controls) |
| @@ -557,19 +558,21 @@ | ||
| 557 | 558 | public function delete_elementor_post( $elementor_id ) { |
| 558 | 559 | if ( empty( $elementor_id ) ) { |
| 559 | 560 | return; |
| 560 | 561 | } |
| 562 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reviewed for the NotificationX codebase: acceptable in this context. | |
| 561 | 563 | $languages = apply_filters( 'wpml_active_languages', null ); |
| 562 | 564 | if ( is_array( $languages ) ) { |
| 563 | 565 | foreach ( $languages as $lang => $val ) { |
| 566 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reviewed for the NotificationX codebase: acceptable in this context. | |
| 564 | 567 | $translated_id = apply_filters( 'wpml_object_id', $elementor_id, 'nx_exit_intent', false, $lang ); |
| 565 | 568 | if ( $translated_id ) { |
| 566 | - wp_delete_post( $translated_id, true ); | |
| 569 | + Helper::delete_owned_post( $translated_id, 'nx_exit_intent' ); | |
| 567 | 570 | } |
| 568 | 571 | } |
| 569 | 572 | return; |
| 570 | 573 | } |
| 571 | - wp_delete_post( $elementor_id, true ); | |
| 574 | + Helper::delete_owned_post( $elementor_id, 'nx_exit_intent' ); | |
| 572 | 575 | } |
| 573 | 576 | |
| 574 | 577 | /** |
| 575 | 578 | * Redirect WP "Edit" links for nx_exit_intent posts straight into the Elementor editor. |
| @@ -1096,8 +1099,38 @@ | ||
| 1096 | 1099 | ], |
| 1097 | 1100 | ], |
| 1098 | 1101 | ]; |
| 1099 | 1102 | |
| 1103 | + // Build With AI tab — Pro feature. Free plugin only registers the tab | |
| 1104 | + // shell + field type; the Pro plugin supplies the actual builder via | |
| 1105 | + // the `nx_build_ai_render` filter (see PressBar's `nxbar_build_with_ai` | |
| 1106 | + // for the same pattern already shipped for Notification Bar). | |
| 1107 | + $tab[] = [ | |
| 1108 | + 'label' => __( 'Build With AI', 'notificationx' ), | |
| 1109 | + 'name' => 'exit_intent_ai_tab', | |
| 1110 | + 'id' => 'exit_intent_ai_tab', | |
| 1111 | + 'type' => 'section', | |
| 1112 | + 'icon' => NOTIFICATIONX_ADMIN_URL . 'images/icons/build-with-ai-icon.svg', | |
| 1113 | + 'rules' => Rules::is( 'source', $this->id ), | |
| 1114 | + 'fields' => [ | |
| 1115 | + 'exit_intent_ai_tab' => [ | |
| 1116 | + 'label' => __( 'Build With AI', 'notificationx' ), | |
| 1117 | + 'name' => 'exit_intent_ai_tab', | |
| 1118 | + 'id' => 'exit_intent_ai_tab', | |
| 1119 | + 'type' => 'section', | |
| 1120 | + 'icon' => NOTIFICATIONX_ADMIN_URL . 'images/responsive/desktop.svg', | |
| 1121 | + 'fields' => [ | |
| 1122 | + 'exit_intent_ai_tab_fields' => [ | |
| 1123 | + 'name' => 'exit_intent_ai_tab_fields', | |
| 1124 | + 'type' => 'exit-intent-build_with_ai', | |
| 1125 | + 'label' => __( 'Exit Intent', 'notificationx' ), | |
| 1126 | + 'priority' => 10, | |
| 1127 | + ], | |
| 1128 | + ], | |
| 1129 | + ], | |
| 1130 | + ], | |
| 1131 | + ]; | |
| 1132 | + | |
| 1100 | 1133 | return $fields; |
| 1101 | 1134 | } |
| 1102 | 1135 | |
| 1103 | 1136 | public function display_fields( $fields ) { |
| @@ -2239,8 +2272,9 @@ | ||
| 2239 | 2272 | return $fields; |
| 2240 | 2273 | } |
| 2241 | 2274 | |
| 2242 | 2275 | public function doc() { |
| 2276 | + /* translators: %1$s: documentation link URL */ | |
| 2243 | 2277 | return sprintf(__(' |
| 2244 | 2278 | <p>Show a targeted message at the exact moment someone is about to close your tab & bring them back into the funnel. Need help? Check out our <a target="_blank" href="%1$s">documentation</a>.</p>', |
| 2245 | 2279 | 'notificationx'), |
| 2246 | 2280 | 'https://notificationx.com/docs/how-to-configure-exit-intent-popup/', |