| | |
| | | use JVBase\JVB; |
| | | use JVBase\rest\RestRouteManager; |
| | | use JVBase\managers\CacheManager; |
| | | use JVBase\utility\Features; |
| | | use WP_User; |
| | | use WP_REST_Request; |
| | | use WP_REST_Response; |
| | |
| | | protected array $voteTables; |
| | | |
| | | protected int $expiryDays = 7; |
| | | protected bool $hasMemberApproval = false; |
| | | |
| | | public function __construct() |
| | | { |
| | | $this->cache_name = 'approvals'; |
| | | $this->hasMemberApproval = Features::forMembership()->has('member_verified'); |
| | | parent::__construct(); |
| | | |
| | | $this->initTypes(); |
| | | |
| | | if (jvbSiteHasMemberApproval()) { |
| | | if ($this->hasMemberApproval) { |
| | | add_action('user_register', [$this, 'handleNewUserRegistration'], 10, 2); |
| | | } |
| | | |
| | |
| | | $approvals = jvbApprovalTypes(); |
| | | $this->userTypes = []; |
| | | $this->termTypes = []; |
| | | if (jvbSiteHasMemberApproval()) { |
| | | if ($this->hasMemberApproval) { |
| | | $this->userTypes = array_filter( |
| | | array_keys($approvals), |
| | | function ($item) { |