-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
image_advanced field inside group disappears on save #922
Comments
I think i'm having the same problem. This seems to fix it: diff --git a/meta-box-group/class-rwmb-group-field.php b/meta-box-group/class-rwmb-group-field.php
index 2999e5f..c2f018b 100644
--- a/meta-box-group/class-rwmb-group-field.php
+++ b/meta-box-group/class-rwmb-group-field.php
@@ -122,7 +122,11 @@ class RWMB_Group_Field extends RWMB_Field {
* @see RWMB_Field::meta()
*/
if ( $child_field['clone'] || $child_field['multiple'] ) {
- if ( empty( $meta ) || ! is_array( $meta ) ) {
+ if ( ! is_array( $meta ) && !empty( $meta ) ) {
+ $meta = array( $meta );
+ }
+
+ if ( empty( $meta ) ) {
/**
* Note: if field is clonable, $meta must be an array with values
* so that the foreach loop in self::show() runs properly |
Same issue here, tried your code but it doesn't work. Running wp 4.8.3 and the latest version of all metabox.io |
Hi, Can you please post your code to create meta boxes? |
|
Then on my functions.php
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am running Wordpress 4.5.3, Meta Box 4.8.7 and Meta Box Group extension 1.1.3. Recently I have experienced issues with using image_advanced field types inside groups: if another field inside the group is edited and the page is saved, the value of the image field disappears. The meta value row is deleted altogether from the database. I would hugely appreciate advice and/or a fix.
The text was updated successfully, but these errors were encountered: