| @@ -104,8 +104,21 @@ | ||
| 104 | 104 | return ''; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | + * Enable the welcome modal only when the installed plugin version matches the exact | |
| 109 | + * release the modal belongs to, so it does not re-appear on later patches/minors | |
| 110 | + * (e.g. 6.0.1, 6.1) that share the same DB version. | |
| 111 | + * | |
| 112 | + * @return void | |
| 113 | + */ | |
| 114 | + public static function maybe_enable_welcome_modal(): void { | |
| 115 | + if ( defined( 'DEFENDER_VERSION' ) && version_compare( DEFENDER_VERSION, self::FEATURE_VERSION, '==' ) ) { | |
| 116 | + update_site_option( self::FEATURE_SLUG, true ); | |
| 117 | + } | |
| 118 | + } | |
| 119 | + | |
| 120 | + /** | |
| 108 | 121 | * Delete welcome modal key. |
| 109 | 122 | * |
| 110 | 123 | * @return void |
| 111 | 124 | */ |