| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\ThirdPartySupport\Elementor\Settings; |
| 4 |
|
| 5 |
/** |
| 6 |
* @since 4.7.0 |
| 7 |
*/ |
| 8 |
class RegisterSettings |
| 9 |
{ |
| 10 |
/** |
| 11 |
* @since 4.7.0 |
| 12 |
*/ |
| 13 |
public function __invoke(array $settings): array |
| 14 |
{ |
| 15 |
if ('elementor' !== give_get_current_setting_section()) { |
| 16 |
return $settings; |
| 17 |
} |
| 18 |
|
| 19 |
return $this->getSettings(); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* @since 4.7.0 |
| 24 |
*/ |
| 25 |
protected function getSettings(): array |
| 26 |
{ |
| 27 |
return [ |
| 28 |
[ |
| 29 |
'id' => 'give_title_settings_elementor_1', |
| 30 |
'type' => 'title', |
| 31 |
], |
| 32 |
$this->getElementorSettings(), |
| 33 |
[ |
| 34 |
'id' => 'give_title_settings_elementor_1', |
| 35 |
'type' => 'sectionend', |
| 36 |
], |
| 37 |
]; |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* @since 4.7.0 |
| 42 |
*/ |
| 43 |
public function getElementorSettings(): array |
| 44 |
{ |
| 45 |
return [ |
| 46 |
'name' => __('Enable Elementor Legacy Widgets', 'give'), |
| 47 |
'desc' => __('If enabled, this option will add legacy widgets to elementor that were previously available in the GiveWP Elementor Widgets plugin.', 'give'), |
| 48 |
'id' => 'givewp_elementor_legacy_widgets_enabled', |
| 49 |
'type' => 'radio_inline', |
| 50 |
'default' => 'disabled', |
| 51 |
'options' => [ |
| 52 |
'enabled' => __('Enabled', 'give'), |
| 53 |
'disabled' => __('Disabled', 'give'), |
| 54 |
], |
| 55 |
]; |
| 56 |
} |
| 57 |
} |
| 58 |
|