← All changes
|
modules/content-generation/class-cartflows-ai-init.php
+22
-0
3.1.4
→
3.3.0
View file →
| @@ -41,11 +41,33 @@ | ||
| 41 | 41 | * @since x.x.x |
| 42 | 42 | */ |
| 43 | 43 | public function __construct() { |
| 44 | 44 | if ( apply_filters( 'cartflows_ai_auth_enabled', true ) ) { |
| 45 | + include_once CARTFLOWS_DIR . 'modules/content-generation/class-cartflows-ai-utils.php'; | |
| 45 | 46 | include_once CARTFLOWS_DIR . 'modules/content-generation/class-cartflows-ai-auth.php'; |
| 46 | 47 | include_once CARTFLOWS_DIR . 'modules/content-generation/class-cartflows-ai-api.php'; |
| 48 | + | |
| 49 | + add_action( 'admin_notices', array( $this, 'render_auth_connected_notice' ) ); | |
| 47 | 50 | } |
| 51 | + } | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * Render a one-shot success banner right after the account is connected. | |
| 55 | + * | |
| 56 | + * @since x.x.x | |
| 57 | + * @return void | |
| 58 | + */ | |
| 59 | + public function render_auth_connected_notice() { | |
| 60 | + if ( ! get_transient( 'cartflows_auth_connected_notice' ) ) { | |
| 61 | + return; | |
| 62 | + } | |
| 63 | + | |
| 64 | + delete_transient( 'cartflows_auth_connected_notice' ); | |
| 65 | + | |
| 66 | + printf( | |
| 67 | + '<div class="notice notice-success is-dismissible"><p>%s</p></div>', | |
| 68 | + esc_html__( 'Your CartFlows account is now connected. Auto Suggest and related Pro features are ready to use.', 'cartflows' ) | |
| 69 | + ); | |
| 48 | 70 | } |
| 49 | 71 | } |
| 50 | 72 | |
| 51 | 73 | /** |