Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterIt gets the stored valued in the post meta with the helper function
rwmb_meta. If the value is empty, then get the default value fromstd.Anh Tran
KeymasterCan you try again?
Anh Tran
KeymasterBut when you imported, you already used
add_post_meta()which converts the array into serialized string. So it's not JSON anymore. I'm quite confused about that.Anh Tran
KeymasterYou can create a helper function for that:
function your_helper( $field_id ) { $field = rwmb_get_field_settings( $field_id ); $value = rwmb_meta( $field_id ); return $value ? $value : $field['std']; } // In your template echo your_helper( 'your_title_field' );Anh Tran
KeymasterYou're right. For multisite, the settings page should be put in the network admin instead of each site's admin and the license key should be stored in the network options. I didn't think about this at first. Let me try to update the plugin.
PS: Just updated the plugin to support multisite. In Multisite environment, the settings page is moved to Network > Settings > Meta Box Updater. Normal site admins won't see the message and that settings page. Please update and let me know how it goes.
PS2: Your license for Core extension bundle is expired. Please update to get updates for other plugins.
Anh Tran
KeymasterHello, I've just added some checks to prevent the error. Please update and let me know how it goes.
Anh Tran
KeymasterHello,
Now I have a Metabox.io Text box that is read only on the post that just displays that JSON data for reference.
Where does the JSON data come from? I see you store an array in the post meta, which is a serialized array.
February 28, 2018 at 12:07 PM in reply to: ✅Conditional Logic not seems working with multiple metaboxes on front-end #8645Anh Tran
KeymasterHi,
Can you send me the code of the meta box to check?
Anh Tran
KeymasterHello, thanks for your feedback. We haven't checked it for Multisite environment. Let me try that.
Edit: I've just fixed the bug. Please update.
Anh Tran
KeymasterHello,
Do you mean that when getting the field value, if the meta box hasn't been saved yet, the
stdvalue is not returned?Well, if the meta box hasn't been saved yet, there's actually no values are saved in the post meta. Thus, the helper functions return empty string. Because the helper functions are just the wrap of
get_post_meta(), which connects to post meta to get the saved value.I'd suggest you do a check to see if the title is empty first.
The reason we don't set the
stdwhen retrieving field value is it's nearly impossible to differentiate a saved empty string (if users really want to save an empty string) to non-saved field value.Anh Tran
KeymasterI see. I fixed that bug 2 weeks ago. I've just released new version of the Meta Box plugin, please update it.
Anh Tran
KeymasterHello,
Unfortunately, the MB Revisions doesn't work with MB Custom Table yet. Give us some time to work on that.
Thanks
Anh Tran
KeymasterHello,
That JS part comes from the MB Conditional Logic extension. It uses WordPress's
wp_localize_scriptto output PHP variables to JavaScript. Any code that usewp_localize_scriptwill have similar output, because it's WordPress's behavior. So we can't do anything here.Besides, this is not an error, just a warning. In HTML5, to make things short,
typeattribute is not necessary forscripttag, but having it doesn't cause any harm or invalidation.Anh Tran
KeymasterHello,
When clone a field or a group, the values of that field or sub-fields will be cleared. This is the expected behavior so users can enter new values in the new cloned fields.
In case you want to keep a pre-defined value for a field/sub-field, please set
'clone_default' => truefor the field/sub-field (in this case, probably is the radio field). This parameter will auto set thestdvalue for new cloned field.Anh Tran
KeymasterHello, I tested with many active plugins:
-
AuthorPosts