| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Announcements\Triggers; |
| 4 |
|
| 5 |
use Elementor\Modules\Announcements\Classes\Trigger_Base; |
| 6 |
use Elementor\User; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
class AiStarted extends Trigger_Base { |
| 13 |
/** |
| 14 |
* @var string |
| 15 |
*/ |
| 16 |
protected $name = 'ai-get-started-announcement'; |
| 17 |
|
| 18 |
public function after_triggered() { |
| 19 |
User::set_introduction_viewed( [ 'introductionKey' => $this->name ] ); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* @return bool |
| 24 |
*/ |
| 25 |
public function is_active(): bool { |
| 26 |
return ! User::get_introduction_meta( 'ai_get_started' ) && ! User::get_introduction_meta( $this->name ); |
| 27 |
} |
| 28 |
} |
| 29 |
|