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
SelectRole.php
57 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePress\Core\Admin\SettingsPages\DragDropBuilder\Fields; |
| 4 | |
| 5 | use ProfilePress\Core\Admin\SettingsPages\DragDropBuilder\FieldBase; |
| 6 | |
| 7 | class SelectRole extends FieldBase |
| 8 | { |
| 9 | public function field_type() |
| 10 | { |
| 11 | return $this->tag_name . '-select-role'; |
| 12 | } |
| 13 | |
| 14 | public static function field_icon() |
| 15 | { |
| 16 | return '<span class="dashicons dashicons-slides"></span>'; |
| 17 | } |
| 18 | |
| 19 | public function field_title() |
| 20 | { |
| 21 | return esc_html__('Select Role', 'wp-user-avatar'); |
| 22 | } |
| 23 | |
| 24 | public function field_settings() |
| 25 | { |
| 26 | return apply_filters('ppress_form_builder_select_role_field_settings', [ |
| 27 | parent::GENERAL_TAB => [ |
| 28 | 'label' => [ |
| 29 | 'label' => esc_html__('Label', 'wp-user-avatar'), |
| 30 | 'field' => self::INPUT_FIELD, |
| 31 | ], |
| 32 | 'options' => [ |
| 33 | 'label' => esc_html__('Options', 'wp-user-avatar'), |
| 34 | 'field' => self::INPUT_FIELD, |
| 35 | 'description' => esc_html__('Enter comma separated list of roles to include in the select dropdown.', 'wp-user-avatar') . |
| 36 | '<br><strong>' . esc_html__('Note:', 'wp-user-avatar') . '</strong> ' . |
| 37 | esc_html__('If left empty, all roles except administrator will be available for selection during registration.', 'wp-user-avatar') |
| 38 | ] |
| 39 | ], |
| 40 | parent::SETTINGS_TAB => [ |
| 41 | 'required' => [ |
| 42 | 'type' => 'checkbox', |
| 43 | 'label' => esc_html__('Required', 'wp-user-avatar'), |
| 44 | 'description' => esc_html__('Force users to fill out this field, otherwise it will be optional.', 'wp-user-avatar'), |
| 45 | 'field' => self::INPUT_FIELD, |
| 46 | ] |
| 47 | ], |
| 48 | parent::STYLE_TAB => [ |
| 49 | 'class' => [ |
| 50 | 'label' => esc_html__('CSS Classes', 'wp-user-avatar'), |
| 51 | 'field' => self::INPUT_FIELD, |
| 52 | 'description' => esc_html__('Enter the CSS class names you would like to add to this field.', 'wp-user-avatar') |
| 53 | ] |
| 54 | ], |
| 55 | ], $this); |
| 56 | } |
| 57 | } |