| 1 |
<?php if (!defined('ABSPATH')) exit; // Exit if accessed directly |
| 2 |
|
| 3 |
/** |
| 4 |
* @var $app FluentCommunity\Framework\Foundation\Application |
| 5 |
*/ |
| 6 |
|
| 7 |
$app->addFilter('fluent_community/auth/signup_fields', function ($fields) { |
| 8 |
$authSettings = \FluentCommunity\App\Services\AuthenticationService::getAuthSettings(); |
| 9 |
if (!empty($authSettings['signup']['form']['fields']['terms'])) { |
| 10 |
$fields['terms'] = $authSettings['signup']['form']['fields']['terms']; |
| 11 |
} |
| 12 |
return $fields; |
| 13 |
}, 10, 1); |
| 14 |
|
| 15 |
$app->addFilter('fluent_community/lockscreen_fields', function ($fields) { |
| 16 |
if (!defined('FLUENTCART_VERSION')) { |
| 17 |
$existingNames = array_column($fields, 'name'); |
| 18 |
if (in_array('paywall', $existingNames)) { |
| 19 |
$fields = array_values(array_filter($fields, function($field) { |
| 20 |
return $field['name'] != 'paywall'; |
| 21 |
})); |
| 22 |
} |
| 23 |
} |
| 24 |
return $fields; |
| 25 |
}, 10, 1); |