Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi,
When I unserialize the value, I see questions and answers are saved correctly:
https://www.unserialize.com/s/54991f6e-ab47-be68-7bdc-00006081513b
FYI, the group extension saves all sub-field values in a serialized array in the database (which is what you just saw). When you get the value, it will be unserialized and returns an array.
Anh Tran
KeymasterHi Cornwall,
The MB Custom Post Type plugin creates only custom post types. No meta boxes or custom fields are created with it. To create meta boxes or custom fields, you'll need MB Builder.
Anh Tran
KeymasterI see, it's much clearer now.
To get the field values from your table CPT, please pass the post ID (value of the field
pricing_table_id) to the 3rd parameter ofrwmb_metafunction. Here is a modified version of your initial code:$table = isset( $pricing['pricing_table_id'] ) ? $pricing['pricing_table_id'] : ''; if ( $table ) { $plans = rwmb_meta( 'plan', '', $table ); // THIS if ( ! empty( $plans ) ) { foreach ($plans as $plan) { $name = isset( $plan['plan_name'] ) ? $plan['plan_name'] : ''; echo $name; } } }Anh Tran
KeymasterHi Huy,
To the the current post object, please use:
$post = get_post();To get fields, just use
rwmb_meta(). But I think you already know that.I'm not sure what your problem is. Can you provide more details and the setup code of meta box, so I can give more useful instruction?
Anh Tran
KeymasterHi Dan,
Unfortunately, creating setting page requires coding. It's just 10 lines of code and you can go to Appearance > Editors to add them into your theme's
functions.phpfile.Then you can use the MB Builder to create fields for settings page using GUI and finally use BB Themer to get the settings and show them on the front end.
Anh Tran
KeymasterHi,
To create a settings page, there are 2 steps:
- Creating a settings page first, using the filter
mb_settings_pages, and - Creating fields for the settings page, using the normal
mb_meta_boxes.
Both steps are described in this documentation. Please take a look and let me know if you see any difficulty.
Anh Tran
KeymasterHi,
I think if you mark a field required, the browser will force you to enter a value. It works per field, which means it doesn't depend on values of other fields. So no matter that field is in a group or not, if it's required, it should have a value.
I'd suggest using custom JavaScript code to check the emptiness of a group (clone) before submitting the post, and not using the required featured. This way, you control when and how the field is "required".
October 13, 2018 at 11:28 AM in reply to: ✅OpenStreetMap is not working properly with Tabs Extension #11617Anh Tran
KeymasterHi Saqib,
Thanks for your feedback. I've just fixed in MB Tabs extension and in Meta Box plugin. Please update MB Tabs and get the dev version of Meta Box on Github. I'll release new version for Meta Box soon.
Thanks
Anh Tran
KeymasterThanks for the info. I'm checking your site and found a problem: the ID of the field contains a space:
https://imgur.elightup.com/sFnaTYm.png
That comes from the
$prefix = strtolower($this->attributes['post']['single']);, which transformCase Studyto justcase study. It should becase_study. Please try this code:$prefix = str_replace(' ', '_', strtolower($this->attributes['post']['single']));The space in field ID (and then in the input name/ID) causes unexpected behavior, and that might be a cause to this problem.
Anh Tran
KeymasterHi Huy,
Do you mean getting the post object or getting the items in the pricing table?
Can you also share the code of the meta box?
October 12, 2018 at 11:12 AM in reply to: ✅MB Revisions in combination with MB Custom Table and Custom Post Type #11603Anh Tran
KeymasterHi Purdue,
There's a bug that MB Revision doesn't work with custom table yet. We're working on that. Please wait for a few days.
Anh Tran
KeymasterPlease do not use
composer update. Try to remove thevendorfolder and docomposer installagain. Runningupdatemakes Composer look up for a higher version than the current4.19.10, which is not available.Anh Tran
KeymasterHi Erik,
The error comes from the version
dev-trunkformeta-boxpackage (the free one). Please specify a correct version like^4.15. There was an error in the tags in SVN for version "4.19.10" (which is not available. It should be "4.14.10"). I'll fix that now.October 11, 2018 at 3:07 PM in reply to: ✅Minimum Plugin needed to support Metabox Repeating text Field? #11597Anh Tran
KeymasterHi Dan,
For both of that, you just need the free Meta Box plugin.
a) For repeating text field, please use the clone feature.
b) For standard fields, it's already supported. Please see the docs here.
If you need advanced repeating fields, such as repeat a group of fields, then you'll need MB Group.
That's all.
- Creating a settings page first, using the filter
-
AuthorPosts