Meta Box - Version 4.10.3

Version Description

  • Fix: force_delete causes files to be deleted even when set to false.
  • Fix: max_file_uploads not working.
Download this release

Release Info

Developer rilwis
Plugin Icon 128x128 Meta Box
Version 4.10.3
Comparing to
See all releases

Code changes from version 4.10.2 to 4.10.3

Files changed (6) hide show
  1. inc/fields/media.php +2 -2
  2. inc/loader.php +1 -1
  3. js/media.js +17 -11
  4. languages/meta-box-pl_PL.po +153 -150
  5. meta-box.php +1 -1
  6. readme.txt +5 -1
inc/fields/media.php CHANGED
@@ -85,8 +85,8 @@ class RWMB_Media_Field extends RWMB_File_Field {
85
 
86
  $field['js_options'] = wp_parse_args( $field['js_options'], array(
87
  'mimeType' => $field['mime_type'],
88
- 'maxFileUploads' => $field['max_file_uploads'],
89
- 'forceDelete' => $field['force_delete'] ? 'true' : 'false',
90
  'maxStatus' => $field['max_status'],
91
  ) );
92
 
85
 
86
  $field['js_options'] = wp_parse_args( $field['js_options'], array(
87
  'mimeType' => $field['mime_type'],
88
+ 'maxFiles' => $field['max_file_uploads'],
89
+ 'forceDelete' => $field['force_delete'] ? true : false,
90
  'maxStatus' => $field['max_status'],
91
  ) );
92
 
inc/loader.php CHANGED
@@ -18,7 +18,7 @@ class RWMB_Loader {
18
  */
19
  protected function constants() {
20
  // Script version, used to add version for scripts and styles.
21
- define( 'RWMB_VER', '4.10.2' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
18
  */
19
  protected function constants() {
20
  // Script version, used to add version for scripts and styles.
21
+ define( 'RWMB_VER', '4.10.3' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
js/media.js CHANGED
@@ -15,6 +15,7 @@ jQuery( function ( $ ) {
15
  this.controller.set( 'length', this.length );
16
  this.controller.set( 'full', max > 0 && this.length >= max );
17
  } );
 
18
  wp.media.model.Attachments.prototype.initialize.call( this, models, options );
19
  },
20
 
@@ -102,7 +103,7 @@ jQuery( function ( $ ) {
102
  // Method to remove media items
103
  removeItem: function ( item ) {
104
  this.get( 'items' ).remove( item );
105
- if ( this.get( 'forceDelete' ) ) {
106
  item.destroy();
107
  }
108
  },
@@ -179,26 +180,31 @@ jQuery( function ( $ ) {
179
  tagName: 'ul',
180
  className: 'rwmb-media-list',
181
 
 
 
 
 
 
 
 
 
 
 
 
182
  //Add item view
183
  addItemView: function ( item ) {
184
- var view = this._views[item.cid] = new this.itemView( {
185
- model: item,
186
- controller: this.controller
187
- } );
188
-
189
- this.$el.append( view.el );
190
  },
191
 
192
  //Remove item view
193
  removeItemView: function ( item ) {
194
- if ( this._views[item.cid] ) {
195
- this._views[item.cid].remove();
196
- delete this._views[item.cid];
197
  }
198
  },
199
 
200
  initialize: function ( options ) {
201
- this._views = {};
202
  this.controller = options.controller;
203
  this.itemView = options.itemView || MediaItem;
204
 
15
  this.controller.set( 'length', this.length );
16
  this.controller.set( 'full', max > 0 && this.length >= max );
17
  } );
18
+
19
  wp.media.model.Attachments.prototype.initialize.call( this, models, options );
20
  },
21
 
103
  // Method to remove media items
104
  removeItem: function ( item ) {
105
  this.get( 'items' ).remove( item );
106
+ if ( this.get( 'forceDelete' ) === true ) {
107
  item.destroy();
108
  }
109
  },
180
  tagName: 'ul',
181
  className: 'rwmb-media-list',
182
 
183
+ getItemView: _.memoize(
184
+ function( item ) {
185
+ return new this.itemView( {
186
+ model: item,
187
+ controller: this.controller
188
+ } );
189
+ },
190
+ function( item ) {
191
+ return item.cid;
192
+ } ),
193
+
194
  //Add item view
195
  addItemView: function ( item ) {
196
+ this.$el.append( this.getItemView( item ).el );
 
 
 
 
 
197
  },
198
 
199
  //Remove item view
200
  removeItemView: function ( item ) {
201
+ var itemView = this.getItemView( item );
202
+ if ( itemView ) {
203
+ itemView.remove();
204
  }
205
  },
206
 
207
  initialize: function ( options ) {
 
208
  this.controller = options.controller;
209
  this.itemView = options.itemView || MediaItem;
210
 
languages/meta-box-pl_PL.po CHANGED
@@ -1,212 +1,215 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: meta-box\n"
4
- "POT-Creation-Date: 2015-05-24 18:55+0100\n"
5
- "PO-Revision-Date: 2015-05-24 18:58+0100\n"
6
- "Last-Translator: \n"
7
- "Language-Team: MM Studio <kontakt@michalmleczko.waw.pl>\n"
8
- "Language: pl_PL\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8\n"
13
  "X-Poedit-Basepath: ..\\\n"
14
- "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
15
- "|| n%100>=20) ? 1 : 2);\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_n_noop:1,2;_nx:1,2;_nx_noop:1,2;"
18
- "_x:1,2c\n"
19
  "X-Poedit-SearchPath-0: .\n"
 
20
 
21
- #: inc/common.php:53
22
- msgid "Documentation"
23
- msgstr "Dokumentacja"
24
 
25
- #: inc/common.php:54
26
- msgid "Extensions"
27
- msgstr "Rozszerzenia"
28
 
29
- #: inc/field.php:229
30
- msgid "+"
31
- msgstr "+"
32
 
33
- #: inc/field.php:242
34
- msgid "&#8211;"
35
- msgstr "&#8211;"
36
 
37
- #: inc/fields/autocomplete.php:18 inc/fields/autocomplete.php:83
38
- #: inc/fields/autocomplete.php:100
39
- msgid "Delete"
40
- msgstr "Usuń"
41
 
42
- #: inc/fields/button.php:35
43
- msgid "Click me"
44
- msgstr "Kliknij mnie"
45
 
46
- #: inc/fields/checkbox.php:75
47
- msgid "Yes"
48
- msgstr "Tak"
49
 
50
- #: inc/fields/checkbox.php:75
51
- msgid "No"
52
- msgstr "Nie"
53
 
54
- #: inc/fields/file-advanced.php:23
55
- msgid "Select Files"
56
- msgstr "Wybierz pliki"
57
 
58
- #: inc/fields/file-advanced.php:66
59
- msgctxt "file upload"
60
- msgid "Select or Upload Files"
61
- msgstr "Wybierz lub wyślij pliki"
62
 
63
- #: inc/fields/file-advanced.php:103 inc/fields/file.php:168
64
- msgctxt "file upload"
65
- msgid "Delete"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  msgstr "Usuń"
67
 
68
- #: inc/fields/file-advanced.php:104 inc/fields/file.php:169
69
- msgctxt "file upload"
70
  msgid "Edit"
71
  msgstr "Edytuj"
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  #: inc/fields/file-input.php:17
74
  msgid "Select File"
75
  msgstr "Wybierz plik"
76
 
77
- #: inc/fields/file-input.php:40
78
  msgid "Select"
79
  msgstr "Zaznacz"
80
 
81
- #: inc/fields/file-input.php:42
82
  msgid "Remove"
83
  msgstr "Usuń"
84
 
85
- #: inc/fields/file.php:19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  #, php-format
87
  msgid "You may only upload maximum %d file"
88
  msgstr "Możesz wysłać maksymalnie %d plik"
89
 
90
- #: inc/fields/file.php:20
91
  #, php-format
92
  msgid "You may only upload maximum %d files"
93
  msgstr "Możesz wysłać maksymalnie %d pliki/plików"
94
 
95
- #: inc/fields/file.php:98
96
  msgid "Error: Cannot delete file"
97
  msgstr "Błąd: Nie można usunąć pliku"
98
 
99
- #: inc/fields/file.php:111
100
  msgctxt "file upload"
101
  msgid "Upload Files"
102
  msgstr "Wyślij pliki"
103
 
104
- #: inc/fields/file.php:112
105
  msgctxt "file upload"
106
  msgid "+ Add new file"
107
  msgstr "+ Dodaj nowy plik"
108
 
109
- #: inc/fields/image-advanced.php:23
110
- msgid "Select Images"
111
- msgstr "Zaznacz zdjęcia"
112
-
113
- #: inc/fields/image-advanced.php:71
114
- msgctxt "image upload"
115
- msgid "Select or Upload Images"
116
- msgstr "Wybierz lub wyślij obrazek"
117
-
118
- #: inc/fields/image-advanced.php:108 inc/fields/image.php:136
119
- msgctxt "image upload"
120
  msgid "Delete"
121
  msgstr "Usuń"
122
 
123
- #: inc/fields/image-advanced.php:109 inc/fields/image.php:137
124
- msgctxt "image upload"
125
  msgid "Edit"
126
  msgstr "Edytuj"
127
 
128
- #: inc/fields/image.php:70 inc/fields/thickbox-image.php:34
129
- msgctxt "image upload"
130
- msgid "Upload Images"
131
- msgstr "Wyślij obrazki"
132
-
133
- #: inc/fields/image.php:71
134
- msgctxt "image upload"
135
- msgid "+ Add new image"
136
- msgstr "Dodaj nowy obrazek"
137
-
138
- #: inc/fields/map.php:46
139
- msgid "Find Address"
140
- msgstr "Wyszukaj adres"
141
-
142
- #: inc/fields/oembed.php:55
143
- msgid "Embed HTML not available."
144
- msgstr "Osadzenie HTML nie jest możliwe."
145
-
146
- #: inc/fields/oembed.php:77
147
- msgid "Preview"
148
- msgstr "Podgląd"
149
-
150
- #: inc/fields/plupload-image.php:105
151
- msgctxt "image upload"
152
- msgid "Drop images here"
153
- msgstr "Upuść obrazki w tym miejscu"
154
-
155
- #: inc/fields/plupload-image.php:106
156
- msgctxt "image upload"
157
- msgid "or"
158
- msgstr "lub"
159
-
160
- #: inc/fields/plupload-image.php:107
161
- msgctxt "image upload"
162
- msgid "Select Files"
163
- msgstr "Wybierz pliki"
164
-
165
- #: inc/fields/plupload-image.php:182
166
- msgctxt "image upload"
167
- msgid "Allowed Image Files"
168
- msgstr "Dozwolene pliki graficzne"
169
-
170
- #: inc/fields/post.php:56
171
- msgid "Select a post"
172
- msgstr "Wybierz wpis"
173
-
174
- #: inc/fields/post.php:60 inc/fields/taxonomy.php:40
175
- #, php-format
176
- msgid "Select a %s"
177
- msgstr "Wybierz %s"
178
-
179
- #: inc/fields/user.php:49
180
  msgid "Select an user"
181
  msgstr "Wybierz użytkownika"
182
-
183
- #: inc/meta-box.php:245
184
- msgid "Please correct the errors highlighted below and try again."
185
- msgstr "Prosze popraw podświetlone błędy i spróbuj ponownie."
186
-
187
- #~ msgid "Select or Upload Files"
188
- #~ msgstr "Wybierz lub wyślij pliki"
189
-
190
- #~ msgid "Edit"
191
- #~ msgstr "Edycja"
192
-
193
- #~ msgid "Upload Files"
194
- #~ msgstr "Wyślij pliki"
195
-
196
- #~ msgid "+ Add new file"
197
- #~ msgstr "+ Dodaj nowy plik"
198
-
199
- #~ msgid "Select or Upload Images"
200
- #~ msgstr "Wybierz lub wyślij obrazek"
201
-
202
- #~ msgid "Upload Images"
203
- #~ msgstr "Wyślij obrazki"
204
-
205
- #~ msgid "+ Add new image"
206
- #~ msgstr "+ Dodaj nowe grafiki"
207
-
208
- #~ msgid "Drop images here"
209
- #~ msgstr "Upuść obrazki w tym miejscu"
210
-
211
- #~ msgid "or"
212
- #~ msgstr "lub"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: meta-box\n"
4
+ "POT-Creation-Date: 2017-02-01 08:56+0000\n"
5
+ "PO-Revision-Date: 2017-02-02 15:01+0000\n"
6
+ "Last-Translator: admin <test@bumerang.vot.pl>\n"
7
+ "Language-Team: Polish\n"
8
+ "Language: pl-PL\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Loco - https://localise.biz/\n"
13
  "X-Poedit-Basepath: ..\\\n"
14
+ "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10 >= 2 && n%10<=4 "
15
+ "&&(n%100<10||n%100 >= 20)? 1 : 2)\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_n_noop:1,2;_nx:1,2;_nx_noop:1,2;_x:1,"
18
+ "2c\n"
19
  "X-Poedit-SearchPath-0: .\n"
20
+ "Report-Msgid-Bugs-To: "
21
 
22
+ #. Name of the plugin
23
+ msgid "Meta Box"
24
+ msgstr "Meta Box"
25
 
26
+ #. Description of the plugin
27
+ msgid "Create custom meta boxes and custom fields in WordPress."
28
+ msgstr "Twórz customowe meta boxy i custom field w Wordpress"
29
 
30
+ #. URI of the plugin
31
+ msgid "https://metabox.io"
32
+ msgstr "https://metabox.io"
33
 
34
+ #. Author of the plugin
35
+ msgid "Rilwis"
36
+ msgstr "Rilwis"
37
 
38
+ #. Author URI of the plugin
39
+ msgid "http://www.deluxeblogtips.com"
40
+ msgstr "http://www.deluxeblogtips.com"
 
41
 
42
+ #: inc/clone.php:95
43
+ msgid "+ Add more"
44
+ msgstr "+ Dodaj więcej"
45
 
46
+ #: inc/fields/select-advanced.php:41
47
+ msgid "Select an item"
48
+ msgstr "Wybierz element"
49
 
50
+ #: inc/fields/taxonomy.php:48
51
+ msgid "Select a term"
52
+ msgstr "Wybierz term"
53
 
54
+ #: inc/fields/select.php:84
55
+ msgid "All"
56
+ msgstr "Wszystko"
57
 
58
+ #: inc/fields/select.php:84
59
+ msgid "None"
60
+ msgstr "Żadne"
 
61
 
62
+ #: inc/fields/media.php:17
63
+ msgctxt "media"
64
+ msgid "+ Add Media"
65
+ msgstr "+ Dodaj plik multimedialny"
66
+
67
+ #: inc/fields/media.php:18
68
+ msgctxt "media"
69
+ msgid " file"
70
+ msgstr "plik"
71
+
72
+ #: inc/fields/media.php:19
73
+ msgctxt "media"
74
+ msgid " files"
75
+ msgstr "pliki"
76
+
77
+ #: inc/fields/media.php:20
78
+ msgctxt "media"
79
+ msgid "Remove"
80
  msgstr "Usuń"
81
 
82
+ #: inc/fields/media.php:21
83
+ msgctxt "media"
84
  msgid "Edit"
85
  msgstr "Edytuj"
86
 
87
+ #: inc/fields/media.php:22
88
+ msgctxt "media"
89
+ msgid "View"
90
+ msgstr "Obejrzyj "
91
+
92
+ #: inc/fields/media.php:23
93
+ msgctxt "media"
94
+ msgid "No Title"
95
+ msgstr "Bez tytułu"
96
+
97
+ #: inc/fields/media.php:26
98
+ msgctxt "media"
99
+ msgid "Select Files"
100
+ msgstr "Wybierz pliki"
101
+
102
+ #: inc/fields/media.php:27
103
+ msgctxt "media"
104
+ msgid "or"
105
+ msgstr "lub"
106
+
107
+ #: inc/fields/media.php:28
108
+ msgctxt "media"
109
+ msgid "Drop files here to upload"
110
+ msgstr "Upuść pliki tutaj,by zuploadować"
111
+
112
+ #: inc/validation.php:47
113
+ msgid "Please correct the errors highlighted below and try again."
114
+ msgstr "Prosze popraw podświetlone błędy i spróbuj ponownie."
115
+
116
+ #: inc/core.php:42
117
+ msgid "Documentation"
118
+ msgstr "Dokumentacja"
119
+
120
+ #: inc/core.php:43
121
+ msgid "Extensions"
122
+ msgstr "Rozszerzenia"
123
+
124
+ #: inc/fields/map.php:57
125
+ msgid "Find Address"
126
+ msgstr "Wyszukaj adres"
127
+
128
+ #: inc/fields/taxonomy.php:51 inc/fields/post.php:36
129
+ #, php-format
130
+ msgid "Select a %s"
131
+ msgstr "Wybierz %s"
132
+
133
+ #: inc/fields/checkbox.php:53
134
+ msgid "Yes"
135
+ msgstr "Tak"
136
+
137
+ #: inc/fields/checkbox.php:53
138
+ msgid "No"
139
+ msgstr "Nie"
140
+
141
+ #: inc/fields/button.php:27
142
+ msgid "Click me"
143
+ msgstr "Kliknij mnie"
144
+
145
  #: inc/fields/file-input.php:17
146
  msgid "Select File"
147
  msgstr "Wybierz plik"
148
 
149
+ #: inc/fields/file-input.php:39 inc/fields/select.php:84
150
  msgid "Select"
151
  msgstr "Zaznacz"
152
 
153
+ #: inc/fields/file-input.php:41
154
  msgid "Remove"
155
  msgstr "Usuń"
156
 
157
+ #: inc/fields/post.php:33
158
+ msgid "Select a post"
159
+ msgstr "Wybierz wpis"
160
+
161
+ #: inc/fields/autocomplete.php:15 inc/fields/autocomplete.php:74
162
+ #: inc/fields/autocomplete.php:89
163
+ msgid "Delete"
164
+ msgstr "Usuń"
165
+
166
+ #: inc/fields/thickbox-image.php:51
167
+ msgctxt "image upload"
168
+ msgid "Upload Images"
169
+ msgstr "Wyślij obrazki"
170
+
171
+ #: inc/fields/oembed.php:60
172
+ msgid "Embed HTML not available."
173
+ msgstr "Osadzenie HTML nie jest możliwe."
174
+
175
+ #: inc/fields/oembed.php:75
176
+ msgid "Preview"
177
+ msgstr "Podgląd"
178
+
179
+ #: inc/fields/file.php:16
180
  #, php-format
181
  msgid "You may only upload maximum %d file"
182
  msgstr "Możesz wysłać maksymalnie %d plik"
183
 
184
+ #: inc/fields/file.php:17
185
  #, php-format
186
  msgid "You may only upload maximum %d files"
187
  msgstr "Możesz wysłać maksymalnie %d pliki/plików"
188
 
189
+ #: inc/fields/file.php:73
190
  msgid "Error: Cannot delete file"
191
  msgstr "Błąd: Nie można usunąć pliku"
192
 
193
+ #: inc/fields/file.php:85
194
  msgctxt "file upload"
195
  msgid "Upload Files"
196
  msgstr "Wyślij pliki"
197
 
198
+ #: inc/fields/file.php:86
199
  msgctxt "file upload"
200
  msgid "+ Add new file"
201
  msgstr "+ Dodaj nowy plik"
202
 
203
+ #: inc/fields/file.php:150
204
+ msgctxt "file upload"
 
 
 
 
 
 
 
 
 
205
  msgid "Delete"
206
  msgstr "Usuń"
207
 
208
+ #: inc/fields/file.php:151
209
+ msgctxt "file upload"
210
  msgid "Edit"
211
  msgstr "Edytuj"
212
 
213
+ #: inc/fields/user.php:33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  msgid "Select an user"
215
  msgstr "Wybierz użytkownika"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
meta-box.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields in WordPress.
6
- * Version: 4.10.2
7
  * Author: Rilwis
8
  * Author URI: http://www.deluxeblogtips.com
9
  * License: GPL2+
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields in WordPress.
6
+ * Version: 4.10.3
7
  * Author: Rilwis
8
  * Author URI: http://www.deluxeblogtips.com
9
  * License: GPL2+
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://paypal.me/anhtnt
4
  Tags: meta-box, custom fields, custom field, meta, meta-boxes, admin, advanced, custom, edit, field, file, image, magic fields, matrix, more fields, Post, repeater, simple fields, text, textarea, type, cms, fields post
5
  Requires at least: 4.1
6
  Tested up to: 4.7.2
7
- Stable tag: 4.10.2
8
  License: GPLv2 or later
9
 
10
  Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
@@ -91,6 +91,10 @@ To getting started with the plugin API, please read [this tutorial](https://meta
91
 
92
  == Changelog ==
93
 
 
 
 
 
94
  = 4.10.2 =
95
  * Improvement: Add `max_file_size` to upload fields (`File_Upload`, `Image_Upload`, `Plupload_Image`).
96
  * Improvement: Add support for attributes for file input.
4
  Tags: meta-box, custom fields, custom field, meta, meta-boxes, admin, advanced, custom, edit, field, file, image, magic fields, matrix, more fields, Post, repeater, simple fields, text, textarea, type, cms, fields post
5
  Requires at least: 4.1
6
  Tested up to: 4.7.2
7
+ Stable tag: 4.10.3
8
  License: GPLv2 or later
9
 
10
  Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
91
 
92
  == Changelog ==
93
 
94
+ = 4.10.3 =
95
+ * Fix: `force_delete` causes files to be deleted even when set to `false`.
96
+ * Fix: `max_file_uploads` not working.
97
+
98
  = 4.10.2 =
99
  * Improvement: Add `max_file_size` to upload fields (`File_Upload`, `Image_Upload`, `Plupload_Image`).
100
  * Improvement: Add support for attributes for file input.