field-settings.php
3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php if ( ! defined( 'ABSPATH' ) ) {
exit;
}
return apply_filters( 'ninja_forms_uploads_field_settings', array(
'save_to_server' => array(
'name' => 'save_to_server',
'type' => 'toggle',
'value' => '1',
'label' => __( 'Save to Server', 'ninja-forms-uploads' ),
'group' => 'primary',
'width' => 'one-half',
'help' => __( 'Save the file to the server.', 'ninja-forms-uploads' ),
),
'upload_rename' => array(
'name' => 'upload_rename',
'type' => 'textbox',
'value' => '',
'label' => __( 'Rename Uploaded File', 'ninja-forms-uploads' ),
'group' => 'primary',
'width' => 'full',
'help' => __( 'Advanced renaming options. You can also create directories using "/". If you do not want to rename the files, leave this box blank', 'ninja-forms-uploads' ),
'use_merge_tags' => true,
),
'media_library' => array(
'name' => 'media_library',
'type' => 'toggle',
'value' => 'false',
'label' => __( 'Save to Media Library', 'ninja-forms-uploads' ),
'group' => 'primary',
'width' => 'one-half',
'help' => __( 'Save to Media Library.', 'ninja-forms-uploads' ),
'deps' => array(
'save_to_server' => true,
),
),
'upload_multi_count' => array(
'name' => 'upload_multi_count',
'type' => 'number',
'label' => __( 'File Limit', 'ninja-forms-uploads' ),
'value' => 1,
'width' => 'one-half',
'group' => 'restrictions',
'help' => __( 'How many files can be uploaded?', 'ninja-forms-uploads' ),
),
'upload_types' => array(
'name' => 'upload_types',
'type' => 'textbox',
'label' => __( 'Allowed File Types', 'ninja-forms-uploads' ),
'help' => __( 'Comma Separated List of allowed file types. An empty list means all file types are accepted. (i.e. jpg, gif, png, pdf) This is not fool-proof and can be tricked, please remember that there is always a danger in allowing users to upload files.', 'ninja-forms-uploads' ),
'group' => 'restrictions',
'width' => 'one-half',
),
'max_file_size' => array(
'name' => 'max_file_size',
'type' => 'number',
'label' => __( 'Maximum File Size (MB)', 'ninja-forms-uploads' ),
'value' => '',
'width' => 'one-half',
'group' => 'restrictions',
'help' => __( 'Maximum size of a file that can be uploaded.', 'ninja-forms-uploads' ),
),
'min_file_size' => array(
'name' => 'min_file_size',
'type' => 'number',
'label' => __( 'Minimum File Size (MB)', 'ninja-forms-uploads' ),
'value' => '0',
'width' => 'one-half',
'group' => 'restrictions',
'help' => __( 'Minimum size of a file that can be uploaded.', 'ninja-forms-uploads' ),
),
'select_files_text' => array(
'name' => 'select_files_text',
'type' => 'textbox',
'value' => __( 'Select Files', 'ninja-forms-uploads' ),
'label' => __( 'Select Files Button Text', 'ninja-forms-uploads' ),
'group' => 'display',
'width' => 'full',
'help' => __( 'Change the button text for selecting files.', 'ninja-forms-uploads' ),
),
'cancel_upload_text' => array(
'name' => 'cancel_upload_text',
'type' => 'textbox',
'value' => __( 'Cancel', 'ninja-forms-uploads' ),
'label' => __( 'Cancel File Upload Button Text', 'ninja-forms-uploads' ),
'group' => 'display',
'width' => 'full',
'help' => __( 'Change the button text for cancelling uploads.', 'ninja-forms-uploads' ),
),
) );