| 1 |
<?php |
| 2 |
|
| 3 |
namespace Hostinger\Admin\Onboarding\Steps; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
abstract class OnboardingStep { |
| 8 |
abstract public function get_title(): string; |
| 9 |
|
| 10 |
abstract public function get_body(): array; |
| 11 |
|
| 12 |
abstract public function step_identifier(): string; |
| 13 |
|
| 14 |
abstract public function get_redirect_link(): string; |
| 15 |
|
| 16 |
public function completed(): bool { |
| 17 |
return in_array( $this->step_identifier(), array_column( $this->get_completed_steps(), 'action' ), true ); |
| 18 |
} |
| 19 |
|
| 20 |
public function get_completed_steps(): array { |
| 21 |
return get_option( 'hostinger_onboarding_steps', array() ); |
| 22 |
} |
| 23 |
} |
| 24 |
|