DefinedFieldTypes
1 month ago
EditProfile
4 years ago
Login
5 years ago
PasswordReset
5 years ago
UserProfile
5 years ago
Bio.php
5 years ago
CFPassword.php
5 years ago
CheckboxList.php
5 years ago
ConfirmEmail.php
5 years ago
ConfirmPassword.php
2 years ago
Country.php
5 years ago
CoverImage.php
4 years ago
Date.php
5 years ago
DisplayName.php
5 years ago
Email.php
5 years ago
FirstName.php
5 years ago
HTML.php
5 years ago
Init.php
5 years ago
LastName.php
5 years ago
Nickname.php
5 years ago
Number.php
5 years ago
Password.php
5 years ago
PasswordStrengthMeter.php
5 years ago
ProfilePicture.php
5 years ago
RadioButtons.php
5 years ago
SelectDropdown.php
5 years ago
SelectRole.php
2 months ago
SingleCheckbox.php
5 years ago
TextBox.php
1 month ago
Textarea.php
5 years ago
Username.php
5 years ago
Website.php
5 years ago
RadioButtons.php
67 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePress\Core\Admin\SettingsPages\DragDropBuilder\Fields; |
| 4 | |
| 5 | |
| 6 | use ProfilePress\Core\Admin\SettingsPages\DragDropBuilder\FieldBase; |
| 7 | |
| 8 | class RadioButtons extends FieldBase |
| 9 | { |
| 10 | public function field_type() |
| 11 | { |
| 12 | return $this->tag_name . '-radio-buttons'; |
| 13 | } |
| 14 | |
| 15 | public static function field_icon() |
| 16 | { |
| 17 | return '<span class="dashicons dashicons-marker"></span>'; |
| 18 | } |
| 19 | |
| 20 | public function field_title() |
| 21 | { |
| 22 | return esc_html__('Radio Buttons', 'wp-user-avatar'); |
| 23 | } |
| 24 | |
| 25 | public function category() |
| 26 | { |
| 27 | return parent::EXTRA_CATEGORY; |
| 28 | } |
| 29 | |
| 30 | public function field_settings() |
| 31 | { |
| 32 | return apply_filters('ppress_form_builder_radio_field_settings', [ |
| 33 | parent::GENERAL_TAB => [ |
| 34 | 'label' => [ |
| 35 | 'label' => esc_html__('Label', 'wp-user-avatar'), |
| 36 | 'field' => self::INPUT_FIELD, |
| 37 | 'description' => ppress_dnd_field_key_description() |
| 38 | ], |
| 39 | 'key' => [ |
| 40 | 'label' => esc_html__('Field Key', 'wp-user-avatar'), |
| 41 | 'field' => self::INPUT_FIELD, |
| 42 | 'description' => ppress_dnd_field_key_description() |
| 43 | ], |
| 44 | 'options' => [ |
| 45 | 'label' => esc_html__('Choices', 'wp-user-avatar'), |
| 46 | 'field' => self::TEXTAREA_FIELD, |
| 47 | 'description' => esc_html__('Enter one choice per line. This will be the options available for user to select.', 'wp-user-avatar') |
| 48 | ] |
| 49 | ], |
| 50 | parent::SETTINGS_TAB => [ |
| 51 | 'required' => [ |
| 52 | 'type' => 'checkbox', |
| 53 | 'label' => esc_html__('Required', 'wp-user-avatar'), |
| 54 | 'description' => esc_html__('Force users to fill out this field, otherwise it will be optional.', 'wp-user-avatar'), |
| 55 | 'field' => self::INPUT_FIELD, |
| 56 | ] |
| 57 | ], |
| 58 | parent::STYLE_TAB => [ |
| 59 | 'class' => [ |
| 60 | 'label' => esc_html__('CSS Classes', 'wp-user-avatar'), |
| 61 | 'field' => self::INPUT_FIELD, |
| 62 | 'description' => esc_html__('Enter the CSS class names you would like to add to this field.', 'wp-user-avatar') |
| 63 | ] |
| 64 | ], |
| 65 | ], $this); |
| 66 | } |
| 67 | } |