PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.6
JetFormBuilder — Dynamic Blocks Form Builder v3.1.6
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / includes / post-meta / messages-meta.php
jetformbuilder / includes / post-meta Last commit date
actions-meta.php 2 years ago args-meta.php 2 years ago base-meta-type.php 2 years ago gateways-meta.php 2 years ago messages-meta.php 2 years ago preset-meta.php 2 years ago recaptcha-meta.php 2 years ago validation-meta.php 2 years ago
messages-meta.php
118 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Post_Meta;
5
6 use Jet_Form_Builder\Classes\Tools;
7
8 // If this file is called directly, abort.
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 class Messages_Meta extends Base_Meta_Type {
14
15 private $messages;
16
17 public function __construct() {
18 $this->messages = apply_filters(
19 // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
20 'jet-form-builder/message-types',
21 $this->get_messages()
22 );
23 }
24
25 public function get_id(): string {
26 return '_jf_messages';
27 }
28
29 public function get_type(): string {
30 return 'string';
31 }
32
33 public function get_default(): string {
34 return Tools::encode_json( $this->get_values() );
35 }
36
37 private function get_messages(): array {
38 return array(
39 'success' => array(
40 'label' => __( 'Form successfully submitted.', 'jet-form-builder' ),
41 'value' => 'Form successfully submitted.',
42 ),
43 'failed' => array(
44 'label' => __( 'Submit failed.', 'jet-form-builder' ),
45 'value' => 'There was an error trying to submit form. Please try again later.',
46 ),
47 'validation_failed' => array(
48 'label' => __( 'Validation error', 'jet-form-builder' ),
49 'value' => 'One or more fields have an error. Please check and try again.',
50 ),
51 'captcha_failed' => array(
52 'label' => __( 'Captcha validation failed', 'jet-form-builder' ),
53 'value' => __( 'Captcha validation failed', 'jet-form-builder' ),
54 ),
55 'invalid_email' => array(
56 'label' => __( 'Entered an invalid email', 'jet-form-builder' ),
57 'value' => 'The e-mail address entered is invalid.',
58 ),
59 'empty_field' => array(
60 'label' => __( 'Required field is empty', 'jet-form-builder' ),
61 'value' => 'The field is required.',
62 ),
63 'internal_error' => array(
64 'label' => __( 'Internal server error', 'jet-form-builder' ),
65 'value' => 'Internal server error. Please try again later.',
66 ),
67 'upload_max_files' => array(
68 'label' => __( 'Media Specific: Max files limit', 'jet-form-builder' ),
69 'value' => 'Maximum upload files limit is reached.',
70 ),
71 'upload_max_size' => array(
72 'label' => __( 'Media Specific: Max size reached', 'jet-form-builder' ),
73 'value' => 'Upload max size exceeded.',
74 ),
75 'upload_mime_types' => array(
76 'label' => __( 'Media Specific: File type error', 'jet-form-builder' ),
77 'value' => 'File type is not allowed.',
78 ),
79 );
80 }
81
82 public function messages(): array {
83 return $this->messages;
84 }
85
86 public function query( $form_id ) {
87 $messages = parent::query( $form_id );
88
89 if ( empty( $messages ) ) {
90 return $this->messages;
91 }
92
93 return array_merge( $this->messages, $messages );
94 }
95
96
97 public function get_values() {
98 return $this->get_by_key( 'label' );
99 }
100
101 public function get_labels(): array {
102 return $this->get_by_key( 'label' );
103 }
104
105 public function get_by_key( $key ): array {
106 $messages = array();
107
108 foreach ( $this->messages as $type => $message ) {
109 if ( ! isset( $message[ $key ] ) ) {
110 break;
111 }
112 $messages[ $type ] = $message[ $key ];
113 }
114
115 return $messages;
116 }
117 }
118