register-user-messages.php
49 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Modules\Actions_V2\Register_User\Messages; |
| 5 | |
| 6 | use Jet_Form_Builder\Actions\Types\Base; |
| 7 | use Jet_Form_Builder\Form_Messages\Actions\Base_Action_Messages; |
| 8 | use JFB_Modules\Actions_V2\Register_User\Register_User_Action; |
| 9 | |
| 10 | // If this file is called directly, abort. |
| 11 | if ( ! defined( 'WPINC' ) ) { |
| 12 | die; |
| 13 | } |
| 14 | |
| 15 | class Register_User_Messages extends Base_Action_Messages { |
| 16 | |
| 17 | public function is_supported( Base $action ): bool { |
| 18 | return is_a( $action, Register_User_Action::class ); |
| 19 | } |
| 20 | |
| 21 | protected function messages(): array { |
| 22 | return array( |
| 23 | 'username_exists' => array( |
| 24 | 'label' => __( 'User login exists', 'jet-form-builder' ), |
| 25 | 'value' => 'This user login already taken.', |
| 26 | ), |
| 27 | 'empty_password' => array( |
| 28 | 'label' => __( 'Empty password', 'jet-form-builder' ), |
| 29 | 'value' => 'Please set user password.', |
| 30 | ), |
| 31 | 'already_logged_in' => array( |
| 32 | 'label' => __( 'Logged in (appears only if register user is only notification)', 'jet-form-builder' ), |
| 33 | 'value' => 'You are already logged in.', |
| 34 | ), |
| 35 | 'not_logged_in' => array( |
| 36 | 'label' => __( |
| 37 | 'Not Logged in (appears only when the "Allow creating new users by existing users" option is enabled)', |
| 38 | 'jet-form-builder' |
| 39 | ), |
| 40 | 'value' => 'You are not logged in.', |
| 41 | ), |
| 42 | 'not_enough_cap' => array( |
| 43 | 'label' => __( 'Not enough capabilities', 'jet-form-builder' ), |
| 44 | 'value' => 'Not enough capabilities to register a user.', |
| 45 | ), |
| 46 | ); |
| 47 | } |
| 48 | } |
| 49 |