Version Description
- 2020-04-06 =
Added
- Add option open info window in Google Maps when loaded
- Add
alpha_channel
& update style to background field - Add support for custom Ajax parameters for object fields.
Fixed
- Fix validation rules still applied for hidden fields
- Fix
image_upload
field select files not working on iPhone - Fix fatal error with Frontend Submission & Elementor
- Fix 'zoom' parameter not working for OSM field on the front end
Changed
- Remove languages folder. Load languages from translate.wordpress.org only
Download this release
Release Info
Developer | rilwis |
Plugin | Meta Box |
Version | 5.2.8 |
Comparing to | |
See all releases |
Code changes from version 5.2.7 to 5.2.8
- css/background.css +7 -3
- css/file-input.css +12 -1
- css/upload.css +7 -18
- inc/fields/background.php +19 -8
- inc/fields/map.php +4 -1
- inc/fields/object-choice.php +8 -2
- inc/fields/osm.php +2 -1
- inc/fields/taxonomy.php +1 -1
- inc/functions.php +5 -1
- inc/loader.php +1 -1
- inc/meta-box.php +1 -1
- inc/templates/upload.php +1 -1
- js/file-upload.js +27 -121
- js/image-upload.js +4 -0
- js/map-frontend.js +4 -0
- js/validate.js +1 -1
- languages/meta-box-ar.mo +0 -0
- languages/meta-box-fa_IR.mo +0 -0
- languages/meta-box-fr_FR.mo +0 -0
- languages/meta-box-it_IT.mo +0 -0
- languages/meta-box-nb_NO.mo +0 -0
- languages/meta-box-nl_NL.mo +0 -0
- languages/meta-box-pl_PL.mo +0 -0
- languages/meta-box-tr_TR.mo +0 -0
- languages/meta-box-zh_CN.mo +0 -0
- meta-box.php +1 -1
- readme.txt +26 -4
css/background.css
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
.rwmb-background-row {
|
2 |
margin-bottom: 5px;
|
|
|
|
|
|
|
3 |
}
|
4 |
.rwmb-background-wrapper .wp-picker-container {
|
5 |
position: relative;
|
@@ -12,6 +15,7 @@
|
|
12 |
min-width: 255px;
|
13 |
}
|
14 |
.rwmb-background-wrapper .rwmb-select {
|
15 |
-
|
16 |
-
|
17 |
-
|
|
1 |
.rwmb-background-row {
|
2 |
margin-bottom: 5px;
|
3 |
+
display: flex;
|
4 |
+
flex-wrap: wrap;
|
5 |
+
align-items: flex-start;
|
6 |
}
|
7 |
.rwmb-background-wrapper .wp-picker-container {
|
8 |
position: relative;
|
15 |
min-width: 255px;
|
16 |
}
|
17 |
.rwmb-background-wrapper .rwmb-select {
|
18 |
+
flex: 1;
|
19 |
+
margin-bottom: 5px;
|
20 |
+
max-width: 100%;
|
21 |
+
}
|
css/file-input.css
CHANGED
@@ -1,6 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
.rwmb-file_input.rwmb-file_input {
|
2 |
line-height: 18px;
|
3 |
-
margin: 0;
|
4 |
padding: 4px;
|
5 |
width: 300px;
|
6 |
}
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.rwmb-file_input-wrapper > .rwmb-input {
|
2 |
+
display: flex;
|
3 |
+
flex-wrap: wrap;
|
4 |
+
align-items: flex-start;
|
5 |
+
}
|
6 |
.rwmb-file_input.rwmb-file_input {
|
7 |
line-height: 18px;
|
8 |
+
margin: 0 5px 0 0;
|
9 |
padding: 4px;
|
10 |
width: 300px;
|
11 |
}
|
12 |
+
@media (max-width: 767px) {
|
13 |
+
.rwmb-file_input.rwmb-file_input,
|
14 |
+
.rwmb-file-input-select {
|
15 |
+
margin-bottom: 5px;
|
16 |
+
}
|
17 |
+
}
|
css/upload.css
CHANGED
@@ -1,28 +1,17 @@
|
|
1 |
.rwmb-upload-area {
|
2 |
-
position: relative;
|
3 |
-
padding-top: 0;
|
4 |
-
margin-top: 0;
|
5 |
height: 200px;
|
6 |
border: 4px dashed #ddd;
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
position: absolute;
|
11 |
-
left: 0;
|
12 |
-
right: 0;
|
13 |
-
top: 50%;
|
14 |
-
transform: translateY(-50%);
|
15 |
-
-webkit-transform: translateY(-50%);
|
16 |
-
-moz-transform: translateY(-50%);
|
17 |
-
-ms-transform: translateY(-50%);
|
18 |
-
margin-top: 10px;
|
19 |
-
}
|
20 |
-
.rwmb-upload-inside p, .rwmb-upload-inside h3 {
|
21 |
text-align: center;
|
22 |
}
|
23 |
.rwmb-upload-inside h3 {
|
24 |
font-size: 20px;
|
25 |
-
line-height:
|
26 |
font-weight: 400;
|
27 |
margin: 0;
|
28 |
}
|
|
|
|
|
|
1 |
.rwmb-upload-area {
|
|
|
|
|
|
|
2 |
height: 200px;
|
3 |
border: 4px dashed #ddd;
|
4 |
+
display: flex;
|
5 |
+
align-items: center;
|
6 |
+
justify-content: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
text-align: center;
|
8 |
}
|
9 |
.rwmb-upload-inside h3 {
|
10 |
font-size: 20px;
|
11 |
+
line-height: 1.4;
|
12 |
font-weight: 400;
|
13 |
margin: 0;
|
14 |
}
|
15 |
+
.rwmb-upload-inside p {
|
16 |
+
margin: .5em 0;
|
17 |
+
}
|
inc/fields/background.php
CHANGED
@@ -15,7 +15,17 @@ class RWMB_Background_Field extends RWMB_Field {
|
|
15 |
public static function admin_enqueue_scripts() {
|
16 |
wp_enqueue_style( 'rwmb-background', RWMB_CSS_URL . 'background.css', '', RWMB_VER );
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
RWMB_File_Input_Field::admin_enqueue_scripts();
|
20 |
}
|
21 |
|
@@ -45,9 +55,10 @@ class RWMB_Background_Field extends RWMB_Field {
|
|
45 |
// Color.
|
46 |
$color = RWMB_Color_Field::normalize(
|
47 |
array(
|
48 |
-
'type'
|
49 |
-
'id'
|
50 |
-
'field_name'
|
|
|
51 |
)
|
52 |
);
|
53 |
$output .= RWMB_Color_Field::html( $meta['color'], $color );
|
@@ -75,7 +86,7 @@ class RWMB_Background_Field extends RWMB_Field {
|
|
75 |
'type' => 'select',
|
76 |
'id' => "{$field['id']}_repeat",
|
77 |
'field_name' => "{$field['field_name']}[repeat]",
|
78 |
-
'placeholder' => esc_html__( '--
|
79 |
'options' => array(
|
80 |
'no-repeat' => esc_html__( 'No Repeat', 'meta-box' ),
|
81 |
'repeat' => esc_html__( 'Repeat All', 'meta-box' ),
|
@@ -93,7 +104,7 @@ class RWMB_Background_Field extends RWMB_Field {
|
|
93 |
'type' => 'select',
|
94 |
'id' => "{$field['id']}_position",
|
95 |
'field_name' => "{$field['field_name']}[position]",
|
96 |
-
'placeholder' => esc_html__( '--
|
97 |
'options' => array(
|
98 |
'top left' => esc_html__( 'Top Left', 'meta-box' ),
|
99 |
'top center' => esc_html__( 'Top Center', 'meta-box' ),
|
@@ -115,7 +126,7 @@ class RWMB_Background_Field extends RWMB_Field {
|
|
115 |
'type' => 'select',
|
116 |
'id' => "{$field['id']}_attachment",
|
117 |
'field_name' => "{$field['field_name']}[attachment]",
|
118 |
-
'placeholder' => esc_html__( '--
|
119 |
'options' => array(
|
120 |
'fixed' => esc_html__( 'Fixed', 'meta-box' ),
|
121 |
'scroll' => esc_html__( 'Scroll', 'meta-box' ),
|
@@ -131,7 +142,7 @@ class RWMB_Background_Field extends RWMB_Field {
|
|
131 |
'type' => 'select',
|
132 |
'id' => "{$field['id']}_size",
|
133 |
'field_name' => "{$field['field_name']}[size]",
|
134 |
-
'placeholder' => esc_html__( '--
|
135 |
'options' => array(
|
136 |
'inherit' => esc_html__( 'Inherit', 'meta-box' ),
|
137 |
'cover' => esc_html__( 'Cover', 'meta-box' ),
|
15 |
public static function admin_enqueue_scripts() {
|
16 |
wp_enqueue_style( 'rwmb-background', RWMB_CSS_URL . 'background.css', '', RWMB_VER );
|
17 |
|
18 |
+
$args = func_get_args();
|
19 |
+
$field = reset( $args );
|
20 |
+
$color = RWMB_Color_Field::normalize(
|
21 |
+
array(
|
22 |
+
'type' => 'color',
|
23 |
+
'id' => "{$field['id']}_color",
|
24 |
+
'field_name' => "{$field['field_name']}[color]",
|
25 |
+
'alpha_channel' => true,
|
26 |
+
)
|
27 |
+
);
|
28 |
+
RWMB_Color_Field::admin_enqueue_scripts( $color );
|
29 |
RWMB_File_Input_Field::admin_enqueue_scripts();
|
30 |
}
|
31 |
|
55 |
// Color.
|
56 |
$color = RWMB_Color_Field::normalize(
|
57 |
array(
|
58 |
+
'type' => 'color',
|
59 |
+
'id' => "{$field['id']}_color",
|
60 |
+
'field_name' => "{$field['field_name']}[color]",
|
61 |
+
'alpha_channel' => true,
|
62 |
)
|
63 |
);
|
64 |
$output .= RWMB_Color_Field::html( $meta['color'], $color );
|
86 |
'type' => 'select',
|
87 |
'id' => "{$field['id']}_repeat",
|
88 |
'field_name' => "{$field['field_name']}[repeat]",
|
89 |
+
'placeholder' => esc_html__( '-- Repeat --', 'meta-box' ),
|
90 |
'options' => array(
|
91 |
'no-repeat' => esc_html__( 'No Repeat', 'meta-box' ),
|
92 |
'repeat' => esc_html__( 'Repeat All', 'meta-box' ),
|
104 |
'type' => 'select',
|
105 |
'id' => "{$field['id']}_position",
|
106 |
'field_name' => "{$field['field_name']}[position]",
|
107 |
+
'placeholder' => esc_html__( '-- Position --', 'meta-box' ),
|
108 |
'options' => array(
|
109 |
'top left' => esc_html__( 'Top Left', 'meta-box' ),
|
110 |
'top center' => esc_html__( 'Top Center', 'meta-box' ),
|
126 |
'type' => 'select',
|
127 |
'id' => "{$field['id']}_attachment",
|
128 |
'field_name' => "{$field['field_name']}[attachment]",
|
129 |
+
'placeholder' => esc_html__( '-- Attachment --', 'meta-box' ),
|
130 |
'options' => array(
|
131 |
'fixed' => esc_html__( 'Fixed', 'meta-box' ),
|
132 |
'scroll' => esc_html__( 'Scroll', 'meta-box' ),
|
142 |
'type' => 'select',
|
143 |
'id' => "{$field['id']}_size",
|
144 |
'field_name' => "{$field['field_name']}[size]",
|
145 |
+
'placeholder' => esc_html__( '-- Size --', 'meta-box' ),
|
146 |
'options' => array(
|
147 |
'inherit' => esc_html__( 'Inherit', 'meta-box' ),
|
148 |
'cover' => esc_html__( 'Cover', 'meta-box' ),
|
inc/fields/map.php
CHANGED
@@ -191,7 +191,7 @@ class RWMB_Map_Field extends RWMB_Field {
|
|
191 |
*/
|
192 |
$google_maps_url = apply_filters( 'rwmb_google_maps_url', $google_maps_url );
|
193 |
wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), RWMB_VER, true );
|
194 |
-
wp_enqueue_script( 'rwmb-map-frontend', RWMB_JS_URL . 'map-frontend.js', array( 'google-maps' ), RWMB_VER, true );
|
195 |
|
196 |
/*
|
197 |
* Google Maps options.
|
@@ -207,6 +207,9 @@ class RWMB_Map_Field extends RWMB_Field {
|
|
207 |
|
208 |
// Map type, see https://developers.google.com/maps/documentation/javascript/reference#MapTypeId.
|
209 |
'mapTypeId' => 'ROADMAP',
|
|
|
|
|
|
|
210 |
)
|
211 |
);
|
212 |
|
191 |
*/
|
192 |
$google_maps_url = apply_filters( 'rwmb_google_maps_url', $google_maps_url );
|
193 |
wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), RWMB_VER, true );
|
194 |
+
wp_enqueue_script( 'rwmb-map-frontend', RWMB_JS_URL . 'map-frontend.js', array( 'google-maps', 'jquery' ), RWMB_VER, true );
|
195 |
|
196 |
/*
|
197 |
* Google Maps options.
|
207 |
|
208 |
// Map type, see https://developers.google.com/maps/documentation/javascript/reference#MapTypeId.
|
209 |
'mapTypeId' => 'ROADMAP',
|
210 |
+
|
211 |
+
// Open Info Window
|
212 |
+
'openInfoWindow' => false,
|
213 |
)
|
214 |
);
|
215 |
|
inc/fields/object-choice.php
CHANGED
@@ -101,8 +101,14 @@ abstract class RWMB_Object_Choice_Field extends RWMB_Choice_Field {
|
|
101 |
return;
|
102 |
}
|
103 |
|
104 |
-
$field['js_options']['ajax']
|
105 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
);
|
107 |
$field['js_options']['ajax_data'] = array(
|
108 |
'field' => array(
|
101 |
return;
|
102 |
}
|
103 |
|
104 |
+
if ( empty( $field['js_options']['ajax'] ) ) {
|
105 |
+
$field['js_options']['ajax'] = array();
|
106 |
+
}
|
107 |
+
$field['js_options']['ajax'] = wp_parse_args(
|
108 |
+
array(
|
109 |
+
'url' => admin_url( 'admin-ajax.php' ),
|
110 |
+
),
|
111 |
+
$field['js_options']['ajax']
|
112 |
);
|
113 |
$field['js_options']['ajax_data'] = array(
|
114 |
'field' => array(
|
inc/fields/osm.php
CHANGED
@@ -139,6 +139,7 @@ class RWMB_OSM_Field extends RWMB_Field {
|
|
139 |
'marker_title' => '', // Marker title, when hover.
|
140 |
'info_window' => '', // Content of info window (when click on marker). HTML allowed.
|
141 |
'js_options' => array(),
|
|
|
142 |
)
|
143 |
);
|
144 |
|
@@ -154,7 +155,7 @@ class RWMB_OSM_Field extends RWMB_Field {
|
|
154 |
$args['js_options'],
|
155 |
array(
|
156 |
// Default to 'zoom' level set in admin, but can be overwritten.
|
157 |
-
'zoom' => $zoom,
|
158 |
)
|
159 |
);
|
160 |
|
139 |
'marker_title' => '', // Marker title, when hover.
|
140 |
'info_window' => '', // Content of info window (when click on marker). HTML allowed.
|
141 |
'js_options' => array(),
|
142 |
+
'zoom' => $zoom,
|
143 |
)
|
144 |
);
|
145 |
|
155 |
$args['js_options'],
|
156 |
array(
|
157 |
// Default to 'zoom' level set in admin, but can be overwritten.
|
158 |
+
'zoom' => $args['zoom'],
|
159 |
)
|
160 |
);
|
161 |
|
inc/fields/taxonomy.php
CHANGED
@@ -351,7 +351,7 @@ class RWMB_Taxonomy_Field extends RWMB_Object_Choice_Field {
|
|
351 |
* @param array $field Field settings.
|
352 |
*/
|
353 |
protected static function remove_default_meta_box( $field ) {
|
354 |
-
if ( empty( $field['remove_default'] ) || ! function_exists( 'remove_meta_box' ) ) {
|
355 |
return;
|
356 |
}
|
357 |
foreach ( $field['taxonomy'] as $taxonomy ) {
|
351 |
* @param array $field Field settings.
|
352 |
*/
|
353 |
protected static function remove_default_meta_box( $field ) {
|
354 |
+
if ( empty( $field['remove_default'] ) || ! is_admin() || ! function_exists( 'remove_meta_box' ) ) {
|
355 |
return;
|
356 |
}
|
357 |
foreach ( $field['taxonomy'] as $taxonomy ) {
|
inc/functions.php
CHANGED
@@ -297,8 +297,12 @@ if ( ! function_exists( 'rwmb_meta_shortcode' ) ) {
|
|
297 |
return $value->$attribute;
|
298 |
}
|
299 |
|
|
|
|
|
|
|
|
|
300 |
$value = wp_list_pluck( $value, $attribute );
|
301 |
-
$value = implode( ',', $value );
|
302 |
|
303 |
return $value;
|
304 |
}
|
297 |
return $value->$attribute;
|
298 |
}
|
299 |
|
300 |
+
if ( isset( $value[ $attribute ] ) ) {
|
301 |
+
return $value[ $attribute ];
|
302 |
+
}
|
303 |
+
|
304 |
$value = wp_list_pluck( $value, $attribute );
|
305 |
+
$value = implode( ',', array_filter( $value ) );
|
306 |
|
307 |
return $value;
|
308 |
}
|
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', '5.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', '5.2.8' );
|
22 |
|
23 |
list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
|
24 |
|
inc/meta-box.php
CHANGED
@@ -312,7 +312,7 @@ class RW_Meta_Box {
|
|
312 |
// Call defined method to save meta value, if there's no methods, call common one.
|
313 |
RWMB_Field::call( $field, 'save', $new, $old, $this->object_id );
|
314 |
|
315 |
-
RWMB_Field::filter( 'after_save_field', null, $field, $new, $old, $this->object_id
|
316 |
}
|
317 |
|
318 |
/**
|
312 |
// Call defined method to save meta value, if there's no methods, call common one.
|
313 |
RWMB_Field::call( $field, 'save', $new, $old, $this->object_id );
|
314 |
|
315 |
+
RWMB_Field::filter( 'after_save_field', null, $field, $new, $old, $this->object_id );
|
316 |
}
|
317 |
|
318 |
/**
|
inc/templates/upload.php
CHANGED
@@ -2,6 +2,6 @@
|
|
2 |
<div class="rwmb-upload-inside">
|
3 |
<h3>{{{ i18nRwmbMedia.uploadInstructions }}}</h3>
|
4 |
<p>{{{ i18nRwmbMedia.or }}}</p>
|
5 |
-
<
|
6 |
</div>
|
7 |
</script>
|
2 |
<div class="rwmb-upload-inside">
|
3 |
<h3>{{{ i18nRwmbMedia.uploadInstructions }}}</h3>
|
4 |
<p>{{{ i18nRwmbMedia.or }}}</p>
|
5 |
+
<button type="button" class="rwmb-browse-button browser button button-hero" id="{{{ _.uniqueId( 'rwmb-upload-browser-') }}}">{{{ i18nRwmbMedia.select }}}</button>
|
6 |
</div>
|
7 |
</script>
|
js/file-upload.js
CHANGED
@@ -25,138 +25,40 @@
|
|
25 |
this.el.id = _.uniqueId( 'rwmb-upload-area-' );
|
26 |
this.render();
|
27 |
|
28 |
-
//Areas
|
29 |
-
this.dropzone = this.el;
|
30 |
-
this.browser = this.$( '.rwmb-browse-button' )[0];
|
31 |
-
|
32 |
-
if ( wp.Uploader.browser.supported ) {
|
33 |
-
this.initUploader();
|
34 |
-
}
|
35 |
-
|
36 |
// Auto hide if you reach the max number of media
|
37 |
this.listenTo( this.controller, 'change:full', function () {
|
38 |
this.$el.toggle( ! this.controller.get( 'full' ) );
|
39 |
} );
|
40 |
},
|
41 |
|
42 |
-
//Initializes plupload
|
43 |
-
//Uses code from wp.Uploader
|
44 |
initUploader: function () {
|
45 |
-
var
|
46 |
-
self = this,
|
47 |
extensions = this.getExtensions().join( ',' ),
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
}, wp.Uploader.defaults );
|
59 |
-
|
60 |
-
if( max_file_size = this.controller.get( 'maxFileSize' ) ) {
|
61 |
-
this.plupload.filters.max_file_size = max_file_size;
|
62 |
-
}
|
63 |
-
|
64 |
-
if ( extensions ) {
|
65 |
-
this.plupload.filters.mime_types = [{title: i18nRwmbMedia.select, extensions: extensions}];
|
66 |
-
}
|
67 |
-
|
68 |
-
// Make sure flash sends cookies (seems in IE it does without switching to urlstream mode)
|
69 |
-
if ( ! isIE && 'flash' === plupload.predictRuntime( this.plupload ) &&
|
70 |
-
( ! this.plupload.required_features || ! this.plupload.required_features.hasOwnProperty( 'send_binary_string' ) ) ) {
|
71 |
-
this.plupload.required_features = this.plupload.required_features || {};
|
72 |
-
this.plupload.required_features.send_binary_string = true;
|
73 |
-
}
|
74 |
-
|
75 |
-
// Initialize the plupload instance.
|
76 |
-
this.uploader = new plupload.Uploader( this.plupload );
|
77 |
-
this.uploader.init();
|
78 |
-
|
79 |
-
this.uploader.bind( 'FilesAdded', function ( up, files ) {
|
80 |
-
_.each( files, function ( file ) {
|
81 |
-
var attributes, image;
|
82 |
-
|
83 |
-
// Ignore failed uploads.
|
84 |
-
if ( plupload.FAILED === file.status ) {
|
85 |
-
return;
|
86 |
-
}
|
87 |
-
|
88 |
-
// Generate attributes for a new `Attachment` model.
|
89 |
-
attributes = _.extend( {
|
90 |
-
file: file,
|
91 |
-
uploading: true,
|
92 |
-
date: new Date(),
|
93 |
-
filename: file.name,
|
94 |
-
menuOrder: 0,
|
95 |
-
uploadedTo: wp.media.model.settings.post.id,
|
96 |
-
icon: i18nRwmbMedia.loadingUrl
|
97 |
-
}, _.pick( file, 'loaded', 'size', 'percent' ) );
|
98 |
-
|
99 |
-
// Handle early mime type scanning for images.
|
100 |
-
image = /(?:jpe?g|png|gif)$/i.exec( file.name );
|
101 |
-
|
102 |
-
// For images set the model's type and subtype attributes.
|
103 |
-
if ( image ) {
|
104 |
-
attributes.type = 'image';
|
105 |
-
|
106 |
-
// `jpeg`, `png` and `gif` are valid subtypes.
|
107 |
-
// `jpg` is not, so map it to `jpeg`.
|
108 |
-
attributes.subtype = ( 'jpg' === image[0] ) ? 'jpeg' : image[0];
|
109 |
}
|
|
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
file.attachment = wp.media.model.Attachment.create( attributes );
|
114 |
-
wp.Uploader.queue.add( file.attachment );
|
115 |
-
self.controller.get( 'items' ).add( [file.attachment] );
|
116 |
-
} );
|
117 |
-
|
118 |
-
up.refresh();
|
119 |
-
up.start();
|
120 |
-
} );
|
121 |
-
|
122 |
-
this.uploader.bind( 'UploadProgress', function ( up, file ) {
|
123 |
-
file.attachment.set( _.pick( file, 'loaded', 'percent' ) );
|
124 |
-
} );
|
125 |
-
|
126 |
-
this.uploader.bind( 'FileUploaded', function ( up, file, response ) {
|
127 |
-
var complete;
|
128 |
-
|
129 |
-
try {
|
130 |
-
response = JSON.parse( response.response );
|
131 |
-
} catch ( e ) {
|
132 |
-
return false;
|
133 |
-
}
|
134 |
-
|
135 |
-
if ( ! _.isObject( response ) || _.isUndefined( response.success ) || ! response.success ) {
|
136 |
-
return false;
|
137 |
-
}
|
138 |
-
|
139 |
-
_.each( ['file', 'loaded', 'size', 'percent'], function ( key ) {
|
140 |
-
file.attachment.unset( key );
|
141 |
-
} );
|
142 |
-
|
143 |
-
file.attachment.set( _.extend( response.data, {uploading: false} ) );
|
144 |
-
wp.media.model.Attachment.get( response.data.id, file.attachment );
|
145 |
-
|
146 |
-
complete = wp.Uploader.queue.all( function ( attachment ) {
|
147 |
-
return ! attachment.get( 'uploading' );
|
148 |
-
} );
|
149 |
-
|
150 |
-
if ( complete ) {
|
151 |
-
wp.Uploader.queue.reset();
|
152 |
-
}
|
153 |
-
} );
|
154 |
|
155 |
-
this.uploader.
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
|
|
|
|
|
|
160 |
},
|
161 |
|
162 |
getExtensions: function () {
|
@@ -184,6 +86,10 @@
|
|
184 |
|
185 |
$this.siblings( '.rwmb-media-view' ).remove();
|
186 |
$this.after( view.el );
|
|
|
|
|
|
|
|
|
187 |
$this.data( 'view', view );
|
188 |
}
|
189 |
|
25 |
this.el.id = _.uniqueId( 'rwmb-upload-area-' );
|
26 |
this.render();
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
// Auto hide if you reach the max number of media
|
29 |
this.listenTo( this.controller, 'change:full', function () {
|
30 |
this.$el.toggle( ! this.controller.get( 'full' ) );
|
31 |
} );
|
32 |
},
|
33 |
|
34 |
+
// Initializes plupload using code from wp.Uploader (wp-includes/js/plupload/wp-plupload.js)
|
|
|
35 |
initUploader: function () {
|
36 |
+
var self = this,
|
|
|
37 |
extensions = this.getExtensions().join( ',' ),
|
38 |
+
maxFileSize = this.controller.get( 'maxFileSize' ),
|
39 |
+
options = {
|
40 |
+
container: this.el,
|
41 |
+
dropzone: this.el,
|
42 |
+
browser: this.$( '.rwmb-browse-button' ),
|
43 |
+
params: {
|
44 |
+
post_id : $( '#post_ID' ).val()
|
45 |
+
},
|
46 |
+
added: function( attachment ) {
|
47 |
+
self.controller.get( 'items' ).add( [attachment] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
+
};
|
50 |
|
51 |
+
// Initialize the plupload instance.
|
52 |
+
this.uploader = new wp.Uploader( options );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
+
var filters = this.uploader.uploader.getOption( 'filters' );
|
55 |
+
if ( maxFileSize ) {
|
56 |
+
filters.max_file_size = maxFileSize;
|
57 |
+
}
|
58 |
+
if ( extensions ) {
|
59 |
+
filters.mime_types = [{title: i18nRwmbMedia.select, extensions: extensions}];
|
60 |
+
}
|
61 |
+
this.uploader.uploader.setOption( 'filters', filters );
|
62 |
},
|
63 |
|
64 |
getExtensions: function () {
|
86 |
|
87 |
$this.siblings( '.rwmb-media-view' ).remove();
|
88 |
$this.after( view.el );
|
89 |
+
|
90 |
+
// Init uploader after view is inserted to make wp.Uploader works.
|
91 |
+
view.addButton.initUploader();
|
92 |
+
|
93 |
$this.data( 'view', view );
|
94 |
}
|
95 |
|
js/image-upload.js
CHANGED
@@ -24,6 +24,10 @@
|
|
24 |
|
25 |
$this.siblings( '.rwmb-media-view' ).remove();
|
26 |
$this.after( view.el );
|
|
|
|
|
|
|
|
|
27 |
$this.data( 'view', view );
|
28 |
}
|
29 |
|
24 |
|
25 |
$this.siblings( '.rwmb-media-view' ).remove();
|
26 |
$this.after( view.el );
|
27 |
+
|
28 |
+
// Init uploader after view is inserted to make wp.Uploader works.
|
29 |
+
view.addButton.initUploader();
|
30 |
+
|
31 |
$this.data( 'view', view );
|
32 |
}
|
33 |
|
js/map-frontend.js
CHANGED
@@ -69,6 +69,10 @@ jQuery( function ( $ ) {
|
|
69 |
google.maps.event.addListener( marker, 'click', function () {
|
70 |
infoWindow.open( map, marker );
|
71 |
} );
|
|
|
|
|
|
|
|
|
72 |
}
|
73 |
}
|
74 |
|
69 |
google.maps.event.addListener( marker, 'click', function () {
|
70 |
infoWindow.open( map, marker );
|
71 |
} );
|
72 |
+
|
73 |
+
if ( true === mapOptions.openInfoWindow ) {
|
74 |
+
infoWindow.open( map, marker );
|
75 |
+
}
|
76 |
}
|
77 |
}
|
78 |
|
js/validate.js
CHANGED
@@ -14,7 +14,7 @@ jQuery( function ( $ ) {
|
|
14 |
$form.trigger( 'after_validate' );
|
15 |
}, 200 );
|
16 |
},
|
17 |
-
ignore: ':not([class|="rwmb"])',
|
18 |
errorPlacement: function( error, element ) {
|
19 |
error.appendTo( element.closest( '.rwmb-input' ) );
|
20 |
},
|
14 |
$form.trigger( 'after_validate' );
|
15 |
}, 200 );
|
16 |
},
|
17 |
+
ignore: ':not([class|="rwmb"]:visible)',
|
18 |
errorPlacement: function( error, element ) {
|
19 |
error.appendTo( element.closest( '.rwmb-input' ) );
|
20 |
},
|
languages/meta-box-ar.mo
DELETED
Binary file
|
languages/meta-box-fa_IR.mo
DELETED
Binary file
|
languages/meta-box-fr_FR.mo
DELETED
Binary file
|
languages/meta-box-it_IT.mo
DELETED
Binary file
|
languages/meta-box-nb_NO.mo
DELETED
Binary file
|
languages/meta-box-nl_NL.mo
DELETED
Binary file
|
languages/meta-box-pl_PL.mo
DELETED
Binary file
|
languages/meta-box-tr_TR.mo
DELETED
Binary file
|
languages/meta-box-zh_CN.mo
DELETED
Binary file
|
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: 5.2.
|
7 |
* Author: MetaBox.io
|
8 |
* Author URI: https://metabox.io
|
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: 5.2.8
|
7 |
* Author: MetaBox.io
|
8 |
* Author URI: https://metabox.io
|
9 |
* License: GPL2+
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== Meta Box - WordPress Custom Fields Framework ===
|
2 |
-
Contributors: metabox, rilwis, fitwp, f-j-kaiser, funkatronic, PerWiklander, ruanmer, Omnicia
|
3 |
Donate link: https://metabox.io/pricing/
|
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.3
|
6 |
Requires PHP: 5.3
|
7 |
-
Tested up to: 5.
|
8 |
-
Stable tag: 5.2.
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
|
@@ -167,10 +167,32 @@ To getting started with the plugin, please read the [Quick Start Guide](https://
|
|
167 |
|
168 |
== Changelog ==
|
169 |
|
170 |
-
= 5.2.
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
**Fixed**
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
- Fix wrong tag when deploying
|
175 |
|
176 |
= 5.2.5 - 2020-02-03 =
|
1 |
=== Meta Box - WordPress Custom Fields Framework ===
|
2 |
+
Contributors: elightup, metabox, rilwis, fitwp, f-j-kaiser, funkatronic, PerWiklander, ruanmer, Omnicia
|
3 |
Donate link: https://metabox.io/pricing/
|
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.3
|
6 |
Requires PHP: 5.3
|
7 |
+
Tested up to: 5.4
|
8 |
+
Stable tag: 5.2.8
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
|
167 |
|
168 |
== Changelog ==
|
169 |
|
170 |
+
= 5.2.8 - 2020-04-06 =
|
171 |
+
|
172 |
+
**Added**
|
173 |
+
|
174 |
+
- Add option open info window in Google Maps when loaded
|
175 |
+
- Add `alpha_channel` & update style to background field
|
176 |
+
- Add support for custom Ajax parameters for object fields.
|
177 |
|
178 |
**Fixed**
|
179 |
|
180 |
+
- Fix validation rules still applied for hidden fields
|
181 |
+
- Fix `image_upload` field select files not working on iPhone
|
182 |
+
- Fix fatal error with Frontend Submission & Elementor
|
183 |
+
- Fix 'zoom' parameter not working for OSM field on the front end
|
184 |
+
|
185 |
+
**Changed**
|
186 |
+
|
187 |
+
- Remove languages folder. Load languages from translate.wordpress.org only
|
188 |
+
|
189 |
+
= 5.2.7 - 2020-02-07 =
|
190 |
+
|
191 |
+
- Fix warning in image field for metadata[‘sizes’].
|
192 |
+
- Allow to quick define text fields with “name” attribute only.
|
193 |
+
|
194 |
+
= 5.2.6 - 2020-02-03 =
|
195 |
+
|
196 |
- Fix wrong tag when deploying
|
197 |
|
198 |
= 5.2.5 - 2020-02-03 =
|